Compile on Linux (Kubuntu): CMake can't find VTK

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Compile on Linux (Kubuntu): CMake can't find VTK

Post by sgrogan »

still mpi issues on 16.10

Code: Select all

/usr/lib/openmpi/include/openmpi/ompi/mpi/cxx/intracomm_inln.h:23: undefined reference to `MPI::Comm::Comm()'
CMakeFiles/SMESH.dir/src/SMESH/DriverMED_Family.cpp.o: In function `MPI::Intracomm::Intracomm()':
/usr/lib/openmpi/include/openmpi/ompi/mpi/cxx/intracomm.h:25: undefined reference to `MPI::Comm::Comm()'
/usr/lib/openmpi/include/openmpi/ompi/mpi/cxx/intracomm.h:25: undefined reference to `MPI::Comm::Comm()'
/usr/lib/openmpi/include/openmpi/ompi/mpi/cxx/intracomm.h:25: undefined reference to `MPI::Comm::Comm()'
/usr/lib/openmpi/include/openmpi/ompi/mpi/cxx/intracomm.h:25: undefined reference to `MPI::Comm::Comm()'
CMakeFiles/SMESH.dir/src/SMESH/DriverMED_Family.cpp.o:/usr/lib/openmpi/include/openmpi/ompi/mpi/cxx/intracomm.h:25: more undefined references to `MPI::Comm::Comm()' follow
CMakeFiles/SMESH.dir/src/SMESH/DriverMED_Family.cpp.o:(.data.rel.ro._ZTVN3MPI8DatatypeE[_ZTVN3MPI8DatatypeE]+0x78): undefined reference to `MPI::Datatype::Free()'
CMakeFiles/SMESH.dir/src/SMESH/DriverMED_Family.cpp.o:(.data.rel.ro._ZTVN3MPI3WinE[_ZTVN3MPI3WinE]+0x48): undefined reference to `MPI::Win::Free()'
collect2: error: ld returned 1 exit status
src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/build.make:1274: recipe for target 'lib/libSMESH.so' failed
make[3]: *** [lib/libSMESH.so] Error 1
make[3]: Leaving directory '/«BUILDDIR»/freecad-daily-0.17~alpha1+git201610200019~ubuntu16.10.1/obj-x86_64-linux-gnu'
CMakeFiles/Makefile2:577: recipe for target 'src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/all' failed
make[2]: *** [src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
I've only modified debian/rules per gdo35's suggestions
https://launchpadlibrarian.net/29012475 ... ING.txt.gz
"fight the good fight"
gdo35
Posts: 189
Joined: Wed Jan 25, 2012 7:25 pm

Re: Compile on Linux (Kubuntu): CMake can't find VTK

Post by gdo35 »

Strange, into the logs, mpic++ is not used... and then there is no link with libmpi and libmpi_cxx. Its like it changes nothing... :?

I will have a look to my comand line to see what is missing.

**EDIT**

If I look at the diff :
https://launchpadlibrarian.net/29012429 ... .1.diff.gz

The part of the diff related to debian/rules :

Code: Select all

diff -Nru freecad-daily-0.17~alpha1+git201607112039~ubuntu16.10.1/debian/rules freecad-daily-0.17~alpha1+git201610200019~ubuntu16.10.1/debian/rules
--- freecad-daily-0.17~alpha1+git201607112039~ubuntu16.10.1/debian/rules	2016-07-11 20:39:45.000000000 +0000
+++ freecad-daily-0.17~alpha1+git201610200019~ubuntu16.10.1/debian/rules	2016-10-20 00:19:45.000000000 +0000
@@ -27,6 +27,7 @@
 override_dh_auto_configure:
 	dh_auto_configure -- $(extra_flags)
 	cp -f src/Build/Version.h obj-$(DEB_BUILD_GNU_TYPE)/src/Build/Version.h
+	-DCMAKE_CXX_COMPILER=/usr/bin/mpic++
 	# fix for Ubuntu bug - 1556680
 	# https://bugs.launchpad.net/ubuntu/+source/oce/+bug/1556680
but the option -DCMAKE_CXX_COMPILER=/usr/bin/mpic++ is an option of dh_auto_configure

You should have something like that :

Code: Select all

 override_dh_auto_configure:
 	dh_auto_configure -- $(extra_flags) -DCMAKE_CXX_COMPILER=/usr/bin/mpic++
 	cp -f src/Build/Version.h obj-$(DEB_BUILD_GNU_TYPE)/src/Build/Version.h
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Compile on Linux (Kubuntu): CMake can't find VTK

Post by sgrogan »

gdo35 wrote:You should have something like that :
I'm all zesty inside: https://launchpad.net/~freecad-maintain ... /+packages :)
"fight the good fight"
gdo35
Posts: 189
Joined: Wed Jan 25, 2012 7:25 pm

Re: Compile on Linux (Kubuntu): CMake can't find VTK

Post by gdo35 »

Yes !!! :lol:

I just updated at wake up, good job ! :D
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Compile on Linux (Kubuntu): CMake can't find VTK

Post by NormandC »

gdo35 wrote:I think it is just a wrapper to "g++ -lpmi -lmpi_cxx"
Sorry, I hadn't read your previous reply to the end. :oops:
sgrogan wrote:I'm all zesty inside
Congrats! Good job guys! :)
Zhukovgreen
Posts: 18
Joined: Tue Dec 13, 2016 5:17 pm

Re: Compile on Linux (Kubuntu): CMake can't find VTK

Post by Zhukovgreen »

Hello,
I am trying to compile the source on ubuntu zesty.

I edited the file "source", so that:

Code: Select all

override_dh_auto_configure:
    dh_auto_configure -- $(extra_flags) -DCMAKE_CXX_COMPILER=/usr/bin/mpic++
    cp -f src/Build/Version.h obj-$(DEB_BUILD_GNU_TYPE)/src/Build/Version.h
But still the error while compiling.

Code: Select all

CMakeFiles/SMESH.dir/src/SMESH/DriverMED_Family.cpp.o: In function `MPI::Intracomm::Intracomm()':
DriverMED_Family.cpp:(.text._ZN3MPI9IntracommC2Ev[_ZN3MPI9IntracommC5Ev]+0x14): undefined reference to `MPI::Comm::Comm()'
CMakeFiles/SMESH.dir/src/SMESH/DriverMED_Family.cpp.o: In function `MPI::Intracomm::Intracomm(ompi_communicator_t*)':
DriverMED_Family.cpp:(.text._ZN3MPI9IntracommC2EP19ompi_communicator_t[_ZN3MPI9IntracommC5EP19ompi_communicator_t]+0x28): undefined reference to `MPI::Comm::Comm()'
CMakeFiles/SMESH.dir/src/SMESH/DriverMED_Family.cpp.o: In function `MPI::Op::Init(void (*)(void const*, void*, int, MPI::Datatype const&), bool)':
DriverMED_Family.cpp:(.text._ZN3MPI2Op4InitEPFvPKvPviRKNS_8DatatypeEEb[_ZN3MPI2Op4InitEPFvPKvPviRKNS_8DatatypeEEb]+0x26): undefined reference to `ompi_mpi_cxx_op_intercept'
CMakeFiles/SMESH.dir/src/SMESH/DriverMED_Family.cpp.o:(.data.rel.ro._ZTVN3MPI3WinE[_ZTVN3MPI3WinE]+0x48): undefined reference to `MPI::Win::Free()'
CMakeFiles/SMESH.dir/src/SMESH/DriverMED_Family.cpp.o:(.data.rel.ro._ZTVN3MPI8DatatypeE[_ZTVN3MPI8DatatypeE]+0x78): undefined reference to `MPI::Datatype::Free()'
collect2: error: ld returned 1 exit status
src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/build.make:1180: recipe for target 'lib/libSMESH.so' failed
make[2]: *** [lib/libSMESH.so] Error 1
CMakeFiles/Makefile2:535: recipe for target 'src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/all' failed
make[1]: *** [src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/all] Error 2
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Compile on Linux (Kubuntu): CMake can't find VTK

Post by jmaustpc »

Zhukovgreen wrote:ubuntu zesty
its best to include the version number not just the silly Ubuntu names that no one can remember which name is what version.

if anyone else is wondering what zesty is, a Google search said it is 17.04.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Compile on Linux (Kubuntu): CMake can't find VTK

Post by sgrogan »

Zhukovgreen wrote: I edited the file "source", so that:
You shouldn't edit any source files. The previous discussion was about the Debian rules file that is needed for the Launchpad autobuild for the PPA.
If compiling locally just add

Code: Select all

-DCMAKE_CXX_COMPILER=/usr/bin/mpic++
to your other Cmake flags.
"fight the good fight"
Zhukovgreen
Posts: 18
Joined: Tue Dec 13, 2016 5:17 pm

Re: Compile on Linux (Kubuntu): CMake can't find VTK

Post by Zhukovgreen »

thank you @sgrogan:
this

Code: Select all

-DCMAKE_CXX_COMPILER=/usr/bin/mpic++
helped
Post Reply