Building FreeCAD on fedora - updated script

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
PrzemoF
Posts: 1706
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Building FreeCAD on fedora - updated script

Postby PrzemoF » Tue Sep 08, 2015 7:10 pm

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 10 times
User avatar
PrzemoF
Posts: 1706
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Building FreeCAD on fedora - updated script

Postby PrzemoF » Tue Jul 05, 2016 10:39 am

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: 464
Joined: Sun May 11, 2014 7:47 pm
Location: Mexico
Contact:

Re: Building FreeCAD on fedora - updated script

Postby drei » Tue Jul 05, 2016 2:50 pm

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
Posts: 1706
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Building FreeCAD on fedora - updated script

Postby PrzemoF » Tue Jul 05, 2016 3:50 pm

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
Posts: 8074
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Building FreeCAD on fedora - updated script

Postby jmaustpc » Tue Jul 05, 2016 4:30 pm

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
Posts: 1706
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Building FreeCAD on fedora - updated script

Postby PrzemoF » Tue Jul 05, 2016 4:43 pm

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

Re: Building FreeCAD on fedora - updated script

Postby PrzemoF » Thu Jul 07, 2016 7:33 am

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
Posts: 12066
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Building FreeCAD on fedora - updated script

Postby NormandC » Sun Jul 10, 2016 4:00 pm

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
Posts: 1706
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Building FreeCAD on fedora - updated script

Postby PrzemoF » Mon Jul 11, 2016 8:28 pm

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
Posts: 12066
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Building FreeCAD on fedora - updated script

Postby NormandC » Tue Jul 12, 2016 3:19 am

PrzemoF wrote:The wiki was going nuts on || symbol.

I would never have figured this one out! :?