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

Having trouble installing or compiling FreeCAD? Get help here.
User avatar
sgrogan
Posts: 3005
Joined: Wed Oct 22, 2014 5:02 pm

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

Postby sgrogan » Thu Oct 20, 2016 12:59 am

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/290124758/buildlog_ubuntu-yakkety-amd64.freecad-daily_0.17~alpha1+git201610200019~ubuntu16.10.1_BUILDING.txt.gz
gdo35
Posts: 173
Joined: Wed Jan 25, 2012 7:25 pm

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

Postby gdo35 » Thu Oct 20, 2016 2:37 am

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
Posts: 3005
Joined: Wed Oct 22, 2014 5:02 pm

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

Postby sgrogan » Thu Oct 20, 2016 5:46 am

gdo35 wrote:You should have something like that :

I'm all zesty inside: https://launchpad.net/~freecad-maintainers/+archive/ubuntu/freecad-daily/+packages :)
gdo35
Posts: 173
Joined: Wed Jan 25, 2012 7:25 pm

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

Postby gdo35 » Thu Oct 20, 2016 8:03 am

Yes !!! :lol:

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

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

Postby NormandC » Fri Oct 21, 2016 1:46 am

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! :)