Building FreeCAD on fedora - updated script

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Building FreeCAD on fedora - updated script

Post by PrzemoF »

I need someone to test it. I believe it should work on fedora 20/21/22.and x86_64/i686. If you never compiled FreeCAD on fedora please try this script! (save attachment, copy to a directory, unzip, start - no questions asked)

Code: Select all

#!/bin/bash

ARCH=$(uname -m)
MAIN_DIR=FreeCAD
BUILD_DIR=build

echo "Architecture: $ARCH"
echo "Main directory: $MAIN_DIR"
echo "Build directory: $BUILD_DIR"

REL_FILE=/etc/redhat-release

if [ -d "$MAIN_DIR" ]
then
	echo "Main directory $MAIN_DIR already exists! Please remove it or use a different directory to start building"
	exit 1
fi

if [ -d "$BUILD_DIR" ]
then
	echo "Build directory $BUILD_DIR already exists! Please remove it or use a different directory to start building"
	exit 1
fi

if [ -f "$REL_FILE" ]
then
	cat $REL_FILE | grep 20 && FEDORA_VERSION=20
	cat $REL_FILE | grep 21 && FEDORA_VERSION=21
	cat $REL_FILE | grep 22 && FEDORA_VERSION=22
else
	echo "Cannot figure out release from $REL_FILE!"
	exit 1
fi

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

mkdir $MAIN_DIR
cd $MAIN_DIR
git clone https://github.com/FreeCAD/FreeCAD_sf_master.git

mkdir $BUILD_DIR
cd $BUILD_DIR
cmake ../FreeCAD_sf_master && make
Attachments
build_FreeCAD.sh.zip
(732 Bytes) Downloaded 63 times
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Building FreeCAD on fedora - updated script

Post by PrzemoF »

Updated script for fedora. Needs testing and attention someone with wiki editing permission :)

Code: Select all

    #!/bin/bash
     
    ARCH=x86_64
    #ARCH=i686
     
    MAIN_DIR=FreeCAD
    BUILD_DIR=build

    #FEDORA_VERSION=21
    FEDORA_VERSION=22
    #FEDORA_VERSION=23
    #FEDORA_VERSION=24
     
    echo "Installing packages required to build FreeCAD"
    sudo dnf -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 med-devel vtk-devel
     
    cd ~
     
    mkdir $MAIN_DIR || { echo "~/$MAIN_DIR already exist. Quitting.."; exit; }
     
    cd $MAIN_DIR
     
    git clone https://github.com/FreeCAD/FreeCAD.git
     
    mkdir $BUILD_DIR || { echo "~/$BUILD_DIR already exist. Quitting.."; exit; }
     
    cd $BUILD_DIR
     
    cmake ../FreeCAD && make
drei
Posts: 479
Joined: Sun May 11, 2014 7:47 pm
Location: Mexico
Contact:

Re: Building FreeCAD on fedora - updated script

Post by drei »

Can someone confirm if it works?

I'll gladly update the wiki page, but I need to be sure that users can compile FreeCAD with the script.
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: Building FreeCAD on fedora - updated script

Post by PrzemoF »

Works for me on fedora 22, I'll test it later on fedora 23. It would be great if someone with fedora 24 tested it.
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Building FreeCAD on fedora - updated script

Post by jmaustpc »

PrzemoF wrote:and attention someone with wiki editing permission :)
I was surprised to see that we have not ever created a wiki editors account for you, this must be just an over sight. I have created it now with the same log in name as your FreeCAD forum log in name. I have given you editor's and Translator's powers. The system should have emailed you a temporary password by now. :)

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

Re: Building FreeCAD on fedora - updated script

Post by PrzemoF »

Thanks!!!! I just logged in :D
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Building FreeCAD on fedora - updated script

Post by PrzemoF »

Script updated, but it needs some attention from a more experienced wiki editor. There is no scroll bar, so only part of the script code is visible. How can I change that?
The page is here: http://www.freecadweb.org/wiki/index.ph ... pileOnUnix
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Building FreeCAD on fedora - updated script

Post by NormandC »

Have a look at the Ubuntu section and compare. You should not add indents for every line inside a Code tag. Indents are added when no tag is used.

Other than that it's been a long time since I've edited anything on the wiki...
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Building FreeCAD on fedora - updated script

Post by PrzemoF »

Thanks! I didn't add the tabs - I have them in the script, so it was copy&paste - I got it fixed.
The wiki was going nuts on || symbol. I added <nowiki>||</nowiki> instead || and it seems to work.
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Building FreeCAD on fedora - updated script

Post by NormandC »

PrzemoF wrote:The wiki was going nuts on || symbol.
I would never have figured this one out! :?
Post Reply