Debian source package for Calculix

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
cblt2l
Posts: 155
Joined: Sat May 15, 2010 3:59 am

Re: Debian source package for Calculix

Post by cblt2l »

MarcoP,

Without seeing the complete log from dpkg-buildpackage I can't say for sure what the problem is, but I'm guessing it might be a dependency related issue. Make sure that you install the packages libspooles-dev libarpack2-dev gfortran from the 'universe' repository along with 'build-essential' and 'debhelper' which is what Norm was referring to. I ran a test using an Ubuntu precise amd64 chroot and was able to build it successfully. The package is here if you want to use it. Keep in mind that its for the amd64 architecture.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Debian source package for Calculix

Post by bernd »

Tried on Debian Jessie and get an error at buildpackage. All the packages mentioned in the first post are installed.

Code: Select all

...
a - strsplt.o
a - tau.o
a - tiedcontact.o
a - u_calloc.o
a - v_betrag.o
a - v_prod.o
a - v_result.o
a - writeBasisParameter.o
make[1]: *** No rule to make target '-larpack', needed by 'ccx_2.7'.  Schluss.
make[1]: Leaving directory '/home/hugo/Documents/projekte--ifc/calculix/ccx-2.7'
dh_auto_build: make -j1 returned exit code 2
debian/rules:13: recipe for target 'build' failed
make: *** [build] Error 2
dpkg-buildpackage: Fehler: Fehler-Exitstatus von debian/rules build war 2
but libarpack is installed. Where is the compiler looking for libarpack?

Code: Select all

locate libarpack
/usr/lib/libarpack.a
/usr/lib/libarpack.so
/usr/lib/libarpack.so.2
/usr/lib/libarpack.so.2.0.0
/usr/share/doc/libarpack2
/usr/share/doc/libarpack2-dev
/usr/share/doc/libarpack2/changelog.Debian.gz
/usr/share/doc/libarpack2/changelog.gz
/usr/share/doc/libarpack2/copyright
/usr/share/doc/libarpack2-dev/README
/usr/share/doc/libarpack2-dev/changelog.Debian.gz
/usr/share/doc/libarpack2-dev/changelog.gz
/usr/share/doc/libarpack2-dev/copyright
/usr/share/doc/libarpack2-dev/debug.doc.gz
/usr/share/doc/libarpack2-dev/ex-complex.doc.gz
/usr/share/doc/libarpack2-dev/ex-nonsym.doc.gz
/usr/share/doc/libarpack2-dev/ex-sym.doc.gz
/usr/share/doc/libarpack2-dev/stat.doc
/var/lib/dpkg/info/libarpack2-dev.list
/var/lib/dpkg/info/libarpack2-dev.md5sums
/var/lib/dpkg/info/libarpack2.list
/var/lib/dpkg/info/libarpack2.md5sums
/var/lib/dpkg/info/libarpack2.postinst
/var/lib/dpkg/info/libarpack2.postrm
/var/lib/dpkg/info/libarpack2.shlibs
/var/lib/dpkg/info/libarpack2.symbols
tom_g
Posts: 1
Joined: Mon Oct 20, 2014 7:30 am

Re: Debian source package for Calculix

Post by tom_g »

Hallo Bernd,

it seems as if the Makefile has an error in line 32.

The explicit make target $(LIBS) does not work because cblt2l chose to use the system development packages for libarpack and libspools, meaning there is no separate make target for those libraries.

With the following change, it compiles OK for me on Ubuntu 14.10 (beta). I guess when using the system libraries, you do not need to compile these separately.

Code: Select all

--- ccx-2.7-orig/Makefile       2014-03-02 17:58:07.000000000 +0100
+++ ccx-2.7-compiles/Makefile   2014-10-21 05:30:21.075851282 +0200
@@ -29,7 +29,7 @@
 
 LIBS = -lspooles -larpack -lm -lpthread -lblas
 
-ccx_2.7: $(OCCXMAIN) $(ACCXMAIN) $(LIBS)
+ccx_2.7: $(OCCXMAIN) $(ACCXMAIN)
        ./date.pl; 
        $(CC) $(CFLAGS) -c $(SCCXMAIN)
        $(FC) -Wall -g -o $@ $(OCCXMAIN) $(ACCXMAIN) $(LIBS)
(Why does the original, upstream calculix Makefile even work? Can you really provide a make target in the form "-lLibrary"?

@cblt2l: The upstream calculix sources for version 2.7 have been changed after release, but for some reason, they didn't change the version number. The current version also compiles OK for me, if I use your Makefile and the debian/ subfolder.

I haven't used the compiled programs yet; i only tried a compilation run. Will try the tools tomorrow.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Debian source package for Calculix

Post by bernd »

tom_g wrote:... The explicit make target $(LIBS) does not work because cblt2l chose to use the system development packages for libarpack and libspools, meaning there is no separate make target for those libraries... I guess when using the system libraries, you do not need to compile these separately.

Code: Select all

--- ccx-2.7-orig/Makefile       2014-03-02 17:58:07.000000000 +0100
+++ ccx-2.7-compiles/Makefile   2014-10-21 05:30:21.075851282 +0200
@@ -29,7 +29,7 @@
 
 LIBS = -lspooles -larpack -lm -lpthread -lblas
 
-ccx_2.7: $(OCCXMAIN) $(ACCXMAIN) $(LIBS)
+ccx_2.7: $(OCCXMAIN) $(ACCXMAIN)
        ./date.pl; 
        $(CC) $(CFLAGS) -c $(SCCXMAIN)
        $(FC) -Wall -g -o $@ $(OCCXMAIN) $(ACCXMAIN) $(LIBS)
...
Yeah changeing the makefile did it on my Debian Jessie !! Thanks tom_g
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Debian source package for Calculix

Post by NormandC »

Has anyone tried doing this from the newer cxx 2.8p2 source?

I just made an attempt, doing the following steps:
  1. Download ccx_2.8p2.src.tar.bz2 from http://www.dhondt.de/
  2. Extract it
  3. Go into ccx_2.8p2/src and move everything up in /ccx_2.8p2
  4. Copy debian folder from cblt2l into ccx_2.8p2
  5. Copy Makefile from cblt2l's to ccx_2.8p2 and overwrite the existing one
  6. In Makefile, edit all mentions of 2.7 version to 2.8p2
  7. In /debian, edit ccx.install, ccx.links and changelog to replace 2.7 with 2.8p2
Running debuild fails:

Code: Select all

gfortran -Wall -g -o ccx_2.8p2 ccx_2.8p2.o ccx_2.8p2.a -lspooles -larpack -lm -lpthread -lblas
ccx_2.8p2.a(dgmres.o): dans la fonction « dcopy_._omp_fn.0 »:
dgmres.f:(.text+0x33): référence indéfinie vers « omp_get_num_threads »
dgmres.f:(.text+0x3b): référence indéfinie vers « omp_get_thread_num »
ccx_2.8p2.a(dgmres.o): dans la fonction « daxpy_._omp_fn.1 »:
dgmres.f:(.text+0x10c): référence indéfinie vers « omp_get_num_threads »
dgmres.f:(.text+0x113): référence indéfinie vers « omp_get_thread_num »
ccx_2.8p2.a(dgmres.o): dans la fonction « daxpy_._omp_fn.2 »:
dgmres.f:(.text+0x2aa): référence indéfinie vers « omp_get_num_threads »
dgmres.f:(.text+0x2b2): référence indéfinie vers « omp_get_thread_num »
ccx_2.8p2.a(dgmres.o): dans la fonction « ddot_._omp_fn.3 »:
dgmres.f:(.text+0x3c1): référence indéfinie vers « omp_get_num_threads »
dgmres.f:(.text+0x3c9): référence indéfinie vers « omp_get_thread_num »
ccx_2.8p2.a(dgmres.o): dans la fonction « dcopy_ »:
dgmres.f:(.text+0x649): référence indéfinie vers « GOMP_parallel_start »
dgmres.f:(.text+0x658): référence indéfinie vers « GOMP_parallel_end »
ccx_2.8p2.a(dgmres.o): dans la fonction « daxpy_ »:
dgmres.f:(.text+0x7e6): référence indéfinie vers « GOMP_parallel_start »
dgmres.f:(.text+0x7f5): référence indéfinie vers « GOMP_parallel_end »
dgmres.f:(.text+0x856): référence indéfinie vers « GOMP_parallel_start »
dgmres.f:(.text+0x865): référence indéfinie vers « GOMP_parallel_end »
ccx_2.8p2.a(dgmres.o): dans la fonction « dhels_ »:
dgmres.f:(.text+0x9e6): référence indéfinie vers « GOMP_parallel_start »
dgmres.f:(.text+0x9f5): référence indéfinie vers « GOMP_parallel_end »
dgmres.f:(.text+0xaaa): référence indéfinie vers « GOMP_parallel_start »
dgmres.f:(.text+0xabc): référence indéfinie vers « GOMP_parallel_end »
ccx_2.8p2.a(dgmres.o): dans la fonction « dorth_ »:
dgmres.f:(.text+0x19f5): référence indéfinie vers « GOMP_parallel_start »
dgmres.f:(.text+0x1a07): référence indéfinie vers « GOMP_parallel_end »
dgmres.f:(.text+0x1ad3): référence indéfinie vers « GOMP_parallel_start »
dgmres.f:(.text+0x1ae5): référence indéfinie vers « GOMP_parallel_end »
dgmres.f:(.text+0x1b9e): référence indéfinie vers « GOMP_parallel_start »
dgmres.f:(.text+0x1bb0): référence indéfinie vers « GOMP_parallel_end »
dgmres.f:(.text+0x1e71): référence indéfinie vers « GOMP_parallel_start »
dgmres.f:(.text+0x1e83): référence indéfinie vers « GOMP_parallel_end »
ccx_2.8p2.a(dgmres.o): dans la fonction « ddot_ »:
dgmres.f:(.text+0x2081): référence indéfinie vers « GOMP_parallel_start »
dgmres.f:(.text+0x2090): référence indéfinie vers « GOMP_parallel_end »
ccx_2.8p2.a(dgmres.o): dans la fonction « dxlcal_ »:
dgmres.f:(.text+0x221c): référence indéfinie vers « GOMP_parallel_start »
dgmres.f:(.text+0x222b): référence indéfinie vers « GOMP_parallel_end »
dgmres.f:(.text+0x22ed): référence indéfinie vers « GOMP_parallel_start »
dgmres.f:(.text+0x22ff): référence indéfinie vers « GOMP_parallel_end »
ccx_2.8p2.a(dgmres.o): dans la fonction « daxpy_._omp_fn.2 »:
dgmres.f:(.text+0x383): référence indéfinie vers « GOMP_barrier »
ccx_2.8p2.a(dgmres.o): dans la fonction « ddot_._omp_fn.3 »:
dgmres.f:(.text+0x4c5): référence indéfinie vers « GOMP_barrier »
ccx_2.8p2.a(dslugm.o): dans la fonction « dslui2_._omp_fn.1 »:
dslugm.f:(.text+0xe): référence indéfinie vers « omp_get_num_threads »
dslugm.f:(.text+0x15): référence indéfinie vers « omp_get_thread_num »
ccx_2.8p2.a(dslugm.o): dans la fonction « dslui2_._omp_fn.0 »:
dslugm.f:(.text+0x13f): référence indéfinie vers « omp_get_num_threads »
dslugm.f:(.text+0x146): référence indéfinie vers « omp_get_thread_num »
ccx_2.8p2.a(dslugm.o): dans la fonction « dsmv_._omp_fn.2 »:
dslugm.f:(.text+0x1c4): référence indéfinie vers « omp_get_num_threads »
dslugm.f:(.text+0x1cb): référence indéfinie vers « omp_get_thread_num »
dslugm.f:(.text+0x20d): référence indéfinie vers « GOMP_barrier »
ccx_2.8p2.a(dslugm.o): dans la fonction « dsmv_._omp_fn.3 »:
dslugm.f:(.text+0x304): référence indéfinie vers « omp_get_num_threads »
dslugm.f:(.text+0x30b): référence indéfinie vers « omp_get_thread_num »
dslugm.f:(.text+0x34b): référence indéfinie vers « GOMP_barrier »
dslugm.f:(.text+0x421): référence indéfinie vers « GOMP_barrier »
ccx_2.8p2.a(dslugm.o): dans la fonction « dsmv_ »:
dslugm.f:(.text+0x570): référence indéfinie vers « GOMP_parallel_start »
dslugm.f:(.text+0x57f): référence indéfinie vers « GOMP_parallel_end »
dslugm.f:(.text+0x5cd): référence indéfinie vers « GOMP_parallel_start »
dslugm.f:(.text+0x5dc): référence indéfinie vers « GOMP_parallel_end »
ccx_2.8p2.a(dslugm.o): dans la fonction « dslui_ »:
dslugm.f:(.text+0x676): référence indéfinie vers « GOMP_parallel_start »
dslugm.f:(.text+0x688): référence indéfinie vers « GOMP_parallel_end »
dslugm.f:(.text+0x755): référence indéfinie vers « GOMP_parallel_start »
dslugm.f:(.text+0x764): référence indéfinie vers « GOMP_parallel_end »
ccx_2.8p2.a(dslugm.o): dans la fonction « dslui2_ »:
dslugm.f:(.text+0x86b): référence indéfinie vers « GOMP_parallel_start »
dslugm.f:(.text+0x87a): référence indéfinie vers « GOMP_parallel_end »
dslugm.f:(.text+0x921): référence indéfinie vers « GOMP_parallel_start »
dslugm.f:(.text+0x930): référence indéfinie vers « GOMP_parallel_end »
ccx_2.8p2.a(dslugm.o): dans la fonction « dslui2_._omp_fn.0 »:
dslugm.f:(.text+0x1aa): référence indéfinie vers « GOMP_barrier »
ccx_2.8p2.a(dslugm.o): dans la fonction « dsmv_._omp_fn.3 »:
dslugm.f:(.text+0x4f0): référence indéfinie vers « GOMP_barrier »
ccx_2.8p2.a(matvec.o): dans la fonction « matvec_._omp_fn.0 »:
matvec.f:(.text+0x18): référence indéfinie vers « omp_get_num_threads »
matvec.f:(.text+0x1f): référence indéfinie vers « omp_get_thread_num »
matvec.f:(.text+0x14c): référence indéfinie vers « GOMP_barrier »
matvec.f:(.text+0x221): référence indéfinie vers « GOMP_barrier »
ccx_2.8p2.a(matvec.o): dans la fonction « matvec_ »:
matvec.f:(.text+0x57f): référence indéfinie vers « GOMP_parallel_start »
matvec.f:(.text+0x58e): référence indéfinie vers « GOMP_parallel_end »
ccx_2.8p2.a(msolve.o): dans la fonction « msolve_._omp_fn.0 »:
msolve.f:(.text+0xe): référence indéfinie vers « omp_get_num_threads »
msolve.f:(.text+0x15): référence indéfinie vers « omp_get_thread_num »
ccx_2.8p2.a(msolve.o): dans la fonction « msolve_ »:
msolve.f:(.text+0x1a2): référence indéfinie vers « GOMP_parallel_start »
msolve.f:(.text+0x1b1): référence indéfinie vers « GOMP_parallel_end »
collect2: error: ld returned 1 exit status
make[1]: *** [ccx_2.8p2] Erreur 1
make[1]: quittant le répertoire « /home/normand2/compilation/calculix/ccx_2.8p2 »
dh_auto_build: make -j1 returned exit code 2
make: *** [build] Erreur 2
dpkg-buildpackage: erreur: debian/rules build a produit une erreur de sortie de type 2
debuild: fatal error at line 1364:
dpkg-buildpackage -rfakeroot -D -us -uc failed
I do not like changing the source code so much, for example moving all the files from the /src folder to the root folder and editing the Makefile.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Debian source package for Calculix

Post by bernd »

Just for keeping it. Found this on github.

https://github.com/ricortiz/CalculiX-cmake
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Debian source package for Calculix

Post by NormandC »

Nice find! Unfortunately the author only made one commit, last year. BTW his GitHub profile indicates he works for Kitware, the primary developer of CMake.

I wonder if it might be better to use it as the source to build the deb package, rather than cblt2l's own modified source which did not include the license file and changed the tree.
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Debian source package for Calculix

Post by NormandC »

FYI, I just found that CalculiX-CrunchiX (the solver) is a prospective package in Debian, someone is working on it (but there is not much activity so far): https://bugs.debian.org/cgi-bin/bugrepo ... bug=767617
gbrugnoni
Posts: 3
Joined: Mon Nov 30, 2015 8:13 am
Location: Italy
Contact:

Re: Debian source package for Calculix

Post by gbrugnoni »

Hi,
I've followed this task trying to fix the mparam problem, that driven me crazy for days.
Finally I've found that the error doesn't depend on netgen version.
I've tried to fix the problem by using netgen-4.9.1, but mparam error was always present.
After some hours of troubles, I've found that freecad executable was completely ignoring the library module libnglib.so.
My mistake was in the NGLIB_LIBRARIES flag of freecad configuration. This flag must be used to indicate the library file, not the library path.


Those are the steps i've succesfully used to build FreeCAD with working FEM module in debian wheezy:

Opencascade configuration, version 6.5.5

Code: Select all

$ cd ros
$ ./build_configure
$ ./configure --prefix=/opt/occt-6.5.5 --with-tcl=/usr/lib --with-tk=/usr/lib --with-freetype=/usr --with-ftgl=/usr --with-gl2ps=/usr --with-freeimage=/usr/ --with-tbb-include=/usr/include/tbb --with-tbb-library=/usr/lib/
$ make -j 8
$ sudo make install
NETGEN Configuration, version 5.3.1

Code: Select all

$ ./configure --enable-nglib --disable-gui --enable-occ --with-occ=/opt/occt-6.5.5 --prefix=/opt/netgen-5.3.1
The file "libsrc/occ/Partition_Loop2d.cxx" must be patched with this little modification: at line 20, add the following line:

Code: Select all

#define PI  M_PI
After this modification the build procedure should run without problems:

Code: Select all

$ make -j 8
$ sudo make install
FreeCAD configuration:

Code: Select all

$ cmake -DFREECAD_USE_EXTERNAL_PIVY=1 \
-DCMAKE_BUILD_TYPE=Debug \
-DPYTHON_LIBRARY=/usr/lib/libpython2.7.so \
-DPYTHON_INCLUDE_DIR=/usr/include/python2.7 \
-DBUILD_FEM_NETGEN=1 \
-DNGLIB_INCLUDE_DIR=/opt/netgen-5.3.1/include \
-DNGLIB_LIBRARIES:FILEPATH=/opt/netgen-5.3.1/lib/libnglib.so \
-DNETGENDATA=/home/user/local/build/netgen/netgen-5.3.1/libsrc \
-DCMAKE_CXX_FLAGS=-DNETGEN_V5 \
-DBUILD_ASSEMBLY=1 \
-DOCC_INCLUDE_DIR=/opt/occt-6.5.5/inc/ \
-DOCC_LIBRARY_DIR=/opt/occt-6.5.5/lib/ \
../src/free-cad-code/

$ make -j 8
$ sudo make install
That's all!
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Debian source package for Calculix

Post by bernd »

@gbrugnoni

thanks for your informations in the regard of netgen but this thread is only for compiling CalculiX ccx !!!
Post Reply