Compiling on fedora 21

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Compiling on fedora 21

Post by PrzemoF »

I'm trying hard to compile freecad from the source code on fedora 21, but I hit a wall. I'm using cmake parameters that are a copy from (working) compilation of version 0.14-3702:

Code: Select all

cmake -DCMAKE_C_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_Fortran_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr -DINCLUDE_INSTALL_DIR:PATH=/usr/include -DLIB_INSTALL_DIR:PATH=/usr/lib64 -DSYSCONF_INSTALL_DIR:PATH=/etc -DSHARE_INSTALL_PREFIX:PATH=/usr/share -DLIB_SUFFIX=64 -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_INSTALL_PREFIX=/usr/lib64/freecad -DCMAKE_INSTALL_DATADIR=/usr/share/freecad -DCMAKE_INSTALL_DOCDIR=/usr/share/doc/freecad -DCMAKE_INSTALL_INCLUDEDIR=/usr/include -DRESOURCEDIR=/usr/share/freecad -DCOIN3D_INCLUDE_DIR=/usr/include/Coin2 -DCOIN3D_DOC_PATH=/usr/share/Coin2/Coin -DFREECAD_USE_EXTERNAL_PIVY=TRUE -DFREECAD_USE_EXTERNAL_SMESH=TRUE -DSMESH_INCLUDE_DIR=/usr/include/smesh -DFREECAD_USE_EXTERNAL_ZIPIOS=TRUE -DPYCXX_INCLUDE_DIR=/usr/include -DPYCXX_SOURCE_DIR=/usr/src/CXX ~/rpmbuild/SOURCES/freecad/free-cad-code/
make fails on:

Code: Select all

In file included from /home/mockbuild/rpmbuild/SOURCES/freecad/free-cad-code/src/Gui/Quarter/SoQTQuarterAdaptor.h:24:0,
                 from /home/mockbuild/rpmbuild/SOURCES/freecad/free-cad-code/src/Gui/View3DInventorViewer.h:36,
                 from /home/mockbuild/rpmbuild/SOURCES/freecad/free-cad-code/src/Gui/Document.cpp:57:
/home/mockbuild/rpmbuild/SOURCES/freecad/free-cad-code/src/Gui/Quarter/QuarterWidget.h:37:38: fatal error: Inventor/SoRenderManager.h: No such file or directory
 #include <Inventor/SoRenderManager.h>
                                      ^
compilation terminated.
src/Gui/CMakeFiles/FreeCADGui.dir/build.make:1136: recipe for target 'src/Gui/CMakeFiles/FreeCADGui.dir/Document.cpp.o' failed
make[2]: *** [src/Gui/CMakeFiles/FreeCADGui.dir/Document.cpp.o] Error 1
make[2]: Leaving directory '/home/mockbuild/rpmbuild/BUILD/freecad-0.15.0000'
CMakeFiles/Makefile2:3565: recipe for target 'src/Gui/CMakeFiles/FreeCADGui.dir/all' failed
make[1]: *** [src/Gui/CMakeFiles/FreeCADGui.dir/all] Error 2
make[1]: Leaving directory '/home/mockbuild/rpmbuild/BUILD/freecad-0.15.0000'
Makefile:120: recipe for target 'all' failed
make: *** [all] Error 2
cmake version: cmake-3.0.2-2.fc21.x86_64

I guess it's no longer possible to use Coin2 with the latest freecad source?
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Compiling on fedora 21

Post by NormandC »

User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Compiling on fedora 21

Post by PrzemoF »

Thanks! I managed to compile freecad with Coin3 and I hit the same draft/fem errors. I compiled and installed Coin3 using some silver tape and elbow grease (source edits to fix freetype path error and --no-deps installation to workaround rpm short-circuited build). It was impossibe to compile freecad with coin2 (SoRenderManager.h missing IIRC)

P.S. There is some Coin3 spec development happening right now in fedora, so the situation might improve: https://bugzilla.redhat.com/show_bug.cgi?id=665733
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Compiling on fedora 21

Post by PrzemoF »

A simple script for fedora [*] to install all required packages, clone repo and build FreeCAD:

http://www.pasteall.org/56959/bash

Code: Select all

#!/bin/bash

ARCH=x86_64
#ARCH=i686

MAIN_DIR=FreeCAD
BUILD_DIR=build

#FEDORA_VERSION=20
FEDORA_VERSION=21
#FEDORA_VERSION=22

cd /tmp

#Coin3 will be soon in official fedora repository, so that step won't be necessary
wget https://kojipkgs.fedoraproject.org//packages/Coin3/3.1.3/7.fc$FEDORA_VERSION/$ARCH/Coin3-3.1.3-7.fc$FEDORA_VERSION.$ARCH.rpm
wget https://kojipkgs.fedoraproject.org//packages/Coin3/3.1.3/7.fc$FEDORA_VERSION/$ARCH/Coin3-devel-3.1.3-7.fc$FEDORA_VERSION.$ARCH.rpm

echo "Installing Coin3 and Coin3-devel"

sudo yum -y install Coin3-3.1.3-7.fc$FEDORA_VERSION.$ARCH.rpm
sudo yum -y install Coin3-devel-3.1.3-7.fc$FEDORA_VERSION.$ARCH.rpm

echo "Installing packages required to build FreeCAD"
sudo yum -y install gcc cmake gcc-c++ boost-devel zlib-devel swig eigen3 qt-devel \
	shiboken shiboken-devel pyside-tools python-pyside python-pyside-devel xerces-c \
	xerces-c-devel OCE-devel smesh graphviz python-pivy python-matplotlib tbb-devel \
	freeimage-devel

cd ~

mkdir $MAIN_DIR || { echo "~/$MAIN_DIR already exist. Quitting.."; exit; }

cd $MAIN_DIR

git clone https://github.com/FreeCAD/FreeCAD_sf_master.git

mkdir $BUILD_DIR || { echo "~/$BUILD_DIR already exist. Quitting.."; exit; }

cd $BUILD_DIR

cmake ../FreeCAD_sf_master && make

[*] Tested on vanilla install of fedora 21/x86_64 in virtualbox, but should also works for fedora 20/22 and i686
drei
Posts: 479
Joined: Sun May 11, 2014 7:47 pm
Location: Mexico
Contact:

Re: Compiling on fedora 21

Post by drei »

Could I get your authorization to add this to the wiki? I'll include a link to your user profile in the forum to ensure you are recognized as author, or I'll leave it anonymous if you wish.
Need help? Feel free to ask, but please read the guidelines first
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Compiling on fedora 21

Post by PrzemoF »

Feel free to use it. I'm fine with the link - I might be able to help if something goes wrong with the script. I'll ask you to update the script when Coin3 in in official fedora repo (it's in testing now) if that's OK.
drei
Posts: 479
Joined: Sun May 11, 2014 7:47 pm
Location: Mexico
Contact:

Re: Compiling on fedora 21

Post by drei »

And it's been added to the wiki. Thanks for your contribution PrzemoF.
Need help? Feel free to ask, but please read the guidelines first
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Compiling on fedora 21

Post by PrzemoF »

I think that last 4 lines of the script are not in the wiki, but anyway Coin3 is now in fedora stable repo, so updated version of the script below:

Code: Select all

#!/bin/bash

ARCH=x86_64
#ARCH=i686

MAIN_DIR=FreeCAD
BUILD_DIR=build

#FEDORA_VERSION=20
FEDORA_VERSION=21
#FEDORA_VERSION=22

echo "Installing packages required to build FreeCAD"
sudo yum -y install gcc cmake gcc-c++ boost-devel zlib-devel swig eigen3 qt-devel \
   shiboken shiboken-devel pyside-tools python-pyside python-pyside-devel xerces-c \
   xerces-c-devel OCE-devel smesh graphviz python-pivy python-matplotlib tbb-devel \
   freeimage-devel Coin3 Coin3-devel

cd ~

mkdir $MAIN_DIR || { echo "~/$MAIN_DIR already exist. Quitting.."; exit; }

cd $MAIN_DIR

git clone https://github.com/FreeCAD/FreeCAD_sf_master.git

mkdir $BUILD_DIR || { echo "~/$BUILD_DIR already exist. Quitting.."; exit; }

cd $BUILD_DIR

cmake ../FreeCAD_sf_master && make
I can't test it right now, so I hope there are no typos.
drei, could you update the wiki?
drei
Posts: 479
Joined: Sun May 11, 2014 7:47 pm
Location: Mexico
Contact:

Re: Compiling on fedora 21

Post by drei »

Done. Glad to hear Fedora finally released the new Coin version.
Need help? Feel free to ask, but please read the guidelines first
Post Reply