French Forest Sector Model (FFSM++)

Laboratoire d'Economie Forestière - LEF - Nancy, France

User Tools

Site Tools


en:dev:development

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:dev:development [2015/02/05 13:59]
Antonello Lobianco created
en:dev:development [2020/07/30 16:32] (current)
Antonello Lobianco [ADOL-C] Reinserted the lib64 trick as it seems it is indeed needed
Line 8: Line 8:
 This section contains detailed instructions on how to get and install the IDE and all the necessary prerequisites, in both Windows or Linux environment. For the former, third party libraries (IPOPT, Adol-C, ColPack) are already available within the FFSM source code repository, so the instruction for their installation refers only to the case that a new version of them is released and the user want to upgrade to it.\\ This section contains detailed instructions on how to get and install the IDE and all the necessary prerequisites, in both Windows or Linux environment. For the former, third party libraries (IPOPT, Adol-C, ColPack) are already available within the FFSM source code repository, so the instruction for their installation refers only to the case that a new version of them is released and the user want to upgrade to it.\\
  
-===== Linux (Ubuntu 14.04) =====+===== Linux (Ubuntu 20.04) =====
  
-The following packages and their prerequisites should be installed: libqt5-*, qtcreator, qmakelibatlas-base-dev, libatlas-dev, gfortranzlib1g-dev+//See older revisions of this page for older Ubuntu systems and for tips to solving some errors no longer occurring in Ubuntu 18.04 and 16.10.// 
 + 
 +The following packages and their prerequisites should be installed: 
 +<code bash> 
 +sudo apt-get install qt5-default qt5-qmake qtcreator libatlas-base-dev gfortran zlib1g-dev libboost-all-dev 
 +</code>
  
 ==== Ipopt ==== ==== Ipopt ====
   * Downolad Ipopt (Ipopt-3.XX.X.tgz) from http://www.coin-or.org/download/source/Ipopt/ and extract it to somewhere where there is no spaces in the path.   * Downolad Ipopt (Ipopt-3.XX.X.tgz) from http://www.coin-or.org/download/source/Ipopt/ and extract it to somewhere where there is no spaces in the path.
-  * In the extracted directory move to ThirdParty and for {Metis|Mumps} go in their subfolder and run "./get.{Metis|Mumps}". This will download and extract them to a place that the ipopt configure will find them. +  * In the extracted directory move to ThirdParty and for {Metis|Mumps|ASL} go in their subfolder and run "./get.{Metis|Mumps|ASL}". This will download and extract them to a place that the ipopt configure will automatically find them. 
-  * For using the HSL linear solver (optional, as it requires a free academic licence, but way faster than MUMS) download ma27-1.0.0.tar.gz, mc19-1.0.0.tar.gz and ma57-3.7.0.tar.gz. Rename ma27d.f and mc19d.f in ma27ad.f and mc19ad.f and place them in ThirdParty/HSL. For ma57create a file ma57ad.f in the same folder and merge into it all the fortran source code coming with the library (excluding fakemetis.f). //New 2013/11/19: as of ipopt 3.11.6 (and maybe earlier version) there is now a new way to get the HSL libraries specifically for ipoptbut the old method also still work (have a look at the relative ipopt readmes).//+  * For using the HSL linear solver (optional, as it requires a free academic licence, but way faster than MUMS) go to http://www.hsl.rl.ac.uk/ipopt/ and download "Coin-HSL Full (Stable)""Source"Wait for the email with the link and then unziprename and move the archive as to be ThirdParty/HSL/coinhsl 
   * Create a build directory, move there and from there type:<code bash>   * Create a build directory, move there and from there type:<code bash>
-../configure --with-blas="-L/usr/lib/atlas-base/atlas -lblas" --with-lapack="-L/usr/lib/atlas-base/atlas -llapack" --prefix="/usr" +../configure --with-blas="-L/usr/lib/atlas-base/atlas -lblas" --with-lapack="-L/usr/lib/atlas-base/atlas -llapack" --prefix="/usr" 'CXXFLAGS=-O3' 'CFLAGS=-O3'
 make make
 sudo make install sudo make install
-# New 2013/11/19: on ubuntu 13.10 64bit and ipopt 3.11.6 run the configure as: 
-../configure --with-blas="-L/usr/lib/atlas-base/atlas -lblas" --with-lapack="-L/usr/lib/atlas-base/atlas -llapack" --prefix="/usr" LDFLAGS=-Wl,--no-as-needed 
 </code> </code>
  
 ==== ColPack ==== ==== ColPack ====
-  * Download ColPack >= 1.0.8 (ColPack-1.X.X.tar.gz) from http://www.cscapes.org/download/ColPack/ and unzip it.+  * Site web: [[https://github.com/CSCsw/ColPack/]] 
 +  * Needed ColPack >= 1.0.8
   * Type:<code bash>   * Type:<code bash>
-./configure prefix=/usr+sudo apt-get install libtool 
 +git clone https://github.com/CSCsw/ColPack.git  # Download ColPack 
 +cd ColPack                                       # ColPack Root Directory 
 +git checkout 10b780b52a25c6ccef3d2abc12055ee85b7e8667 # checkout a version know to works 
 +autoreconf -vif                                 
 +./configure --prefix=/usr 'CXXFLAGS=-O3' 'CFLAGS=-O3'
 make make
 sudo make install sudo make install
 </code> </code>
-//Notes: if you get an error about libtool version mismatch run "autoreconf --force --install" before configure +
-(http://stackoverflow.com/questions/3096989/libtool-version-mismatch-error)//+
  
 ==== ADOL-C ==== ==== ADOL-C ====
Line 38: Line 46:
   * Download ADOL-C (ADOL-C-2.X.X.tgz) from http://www.coin-or.org/download/source/ADOL-C/   * Download ADOL-C (ADOL-C-2.X.X.tgz) from http://www.coin-or.org/download/source/ADOL-C/
   * Type:<code bash>   * Type:<code bash>
-./configure --enable-docexa --enable-addexa --enable-sparse prefix=/usr+./configure --enable-docexa --enable-addexa --enable-sparse --prefix=/usr 'CXXFLAGS=-O3' 'CFLAGS=-O3'
 make make
 sudo make install sudo make install
 </code> </code>
-//New 2013/11/19: On 64 bits Linux, symlink all libadoc.* libraries from /usr/lib64 to /usr/lib, e.g. ln -s ../lib64/libadolc.so.libadolc.so.1.1.1\\ + 
-Notes: If you have an error about libtool version mismatch run "autoreconf --force --install" before configure (http://stackoverflow.com/questions/3096989/libtool-version-mismatch-error - https://dev.openwrt.org/ticket/10827 )//+  * On 64 bits Linux, symlink all libadoc.* libraries from /usr/lib64 to /usr/lib:<code bash> 
 +cd /usr/lib 
 +sudo ln -s ../lib64/libadolc.la .  
 +sudo ln -s ../lib64/libadolc.so . 
 +sudo ln -s ../lib64/libadolc.so.
 +sudo ln -s ../lib64/libadolc.so.2.1.0 . 
 +</code>
  
 ===== Windows (XP or 7) ===== ===== Windows (XP or 7) =====
  
 +New Sept 2018 (work in progress)
 +
 +Download:
 +  - qt installer from https://qt.io
 +    - modules Qt 5.11.1 (MinGW 5.3.0 32 bits)
 +    - tools:
 +      - Qt Creator 4.7.0 CDB Debug Suport
 +      - MinGW 5.3.0
 +      -  Qt Installer Framework 3.0
 +  - Git for windows from https://gitforwindows.org
 +  - Tortoise Git from https://tortoisegit.org
 ===== MinGW ===== ===== MinGW =====
  
Line 90: Line 115:
 </code> </code>
 //Notes: These instructions were written for the now obsolete Qt4. We didn't tested them with the newer Qt5 that are required by the model, but we think the procedure should be similar. Qt 4.8.3 had a know bug that required adding QMAKE_RCC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}rcc.exe after the QMAKE_IDC line in C:\Qt\4.8.3\mkspecs\win32-g++\qmake.conf// //Notes: These instructions were written for the now obsolete Qt4. We didn't tested them with the newer Qt5 that are required by the model, but we think the procedure should be similar. Qt 4.8.3 had a know bug that required adding QMAKE_RCC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}rcc.exe after the QMAKE_IDC line in C:\Qt\4.8.3\mkspecs\win32-g++\qmake.conf//
 +
 +//Update 20150929: We didn't yet tested Qt5, as unfortunately as they are now shipped together with MinGW, this would means to update also the windows MinGW compiler. In turn this mean to have to recompile all the ThirdParty libraries. We stuck with the Qt4.8/MinGW 4.6.2 for now.\\
 +To allow compilation of the code with Qt4.8 instead of Qt5, just comment "#include <QtWidgets>" and decomment "#include <QtGui>" on top of InputNode.cpp, MapBox.cpp, ScenarioSelectionWidget.cpp and MainWindow.cpp. On this last file also comment '#include "QApplication"'.\\
 +To use Qt5 attenction that most likely you will have to give the full path of the external libraries in the project file and you'll have to compile zlib by yourself (as it's no longer shipped with Qt5). //
  
 ==== Ipopt (optional) ==== ==== Ipopt (optional) ====
Line 166: Line 195:
 A guide to Qt Creator is out of this paper scope, as abundant documentation can be retrieved from either official and unofficial sources. Hence, we describe here just the very basic operations required to modify and compile the code.\\ A guide to Qt Creator is out of this paper scope, as abundant documentation can be retrieved from either official and unofficial sources. Hence, we describe here just the very basic operations required to modify and compile the code.\\
 To start the IDE click on the file ffsm.pro. The first time Qt Creator will ask the version of Qt to be used for the project, where the default choices can be accepted.\\ To start the IDE click on the file ffsm.pro. The first time Qt Creator will ask the version of Qt to be used for the project, where the default choices can be accepted.\\
 +A few tips (see screenshots):
 +  - In the Configure project option, choose the dot (".") for the Debug and release directory
 +  - In the build and run be sure that Qt5 is selected as default Qt and the default gdb is selected as debugger (it wasn't in a clean install on my machine)
 +  - In order to watch STL containers while degugging, in the debug options uncheck the "Load system GDB pretty printers"
 +
 +{{:en:dev:qt_configuration.png?direct&0x120|}} {{:en:dev:gdb_debugger.png?direct&0x120|}} {{:en:dev:qtcreator_gdb_option.png?direct&0x120|}}
 +
 The icons on the bottom of the left panel allow to perform the main actions at the project level: to compile it (//hammer icon//), debug it (//bug icon//) and run it (//play icon//). The icons on the bottom of the left panel allow to perform the main actions at the project level: to compile it (//hammer icon//), debug it (//bug icon//) and run it (//play icon//).
  
en/dev/development.1423141153.txt.gz · Last modified: 2018/06/18 16:44 (external edit)