User Tools

Site Tools


build:fallbacks

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
build:fallbacks [2020/08/19 09:31] – [The configuration of a package fails] Jean-Michel Beukenbuild:fallbacks [2020/08/19 12:55] (current) – [Building the fallbacks with Abinit] Jean-Michel Beuken
Line 101: Line 101:
 ===== Building the fallbacks with Abinit ===== ===== Building the fallbacks with Abinit =====
  
-For convenience, a release of the fallbacks comes with the source tarball of Abinit. It is possible to build it along with Abinit, although much more efficient to build it and install it separately, since you do not have to rebuild the fallbacks each time you wish to make a new build of Abinit. Please note that the version of the fallbacks you may find within the Abinit source tree will always be outdated.+For convenience, a release of the fallbacks comes with the source tarball of Abinit.\\ 
 +It is possible to build it along with Abinit, although much more efficient to build it and install it separately, since you do not have to rebuild the fallbacks each time you wish to make a new build of Abinit.\\  
 +/*Please note that the version of the fallbacks you may find within the Abinit source tree will perhaps be outdated.*/
  
-Building the fallbacks within Abinit is mainly of interest to developers who want to experiment with compile flags and explore issues related to compilers and portability. It can also help - to a reduced extent only - users who are stuck within very rigid configurations and restricted build environments. Here is the way to proceed:+Building the fallbacks within Abinit is mainly of interest to developers who want to experiment with compile flags and explore issues related to compilers and portability. It can also help - to a reduced extent only - users who are stuck within very rigid configurations and restricted build environments.\\ 
 +Here is the way to proceed:
 <code bash> <code bash>
 tar xvzf abinit-x.y.z.tar.gz tar xvzf abinit-x.y.z.tar.gz
Line 109: Line 112:
 mkdir tmp-build mkdir tmp-build
 cd tmp-build cd tmp-build
-../configure + 
-  --prefix="/abinit/install/path" ... options ... \ +# Create a "config.ac9" file with all needed options 
-Abinit drops a build script into the transient/ subdirectory and configure +../configure --with-config-file="config.ac9" 
-# fails because the fallbacks are missing and cannot be tested+</code> 
-cd transient + 
-# Edit the build-abinit-fallbacks.sh script and set its install prefix +What happens in this case is that we first configure Abinit, so that it generates all the necessary information to build the fallbacks for missing external dependencies. The configure script of Abinit always gives priority to properly-installed external dependencies and will only select the minimal necessary fallbacks, in order to save time, trigger less bugs, and aim at maximum reliability.\\ 
-# as instructed therein+At this stage, the configure script has to fail, because it cannot anticipate the successful build of the fallbacks. 
 + 
 +<code bash> 
 +cd fallbacks
 ./build-abinit-fallbacks.sh ./build-abinit-fallbacks.sh
-make + 
-make install+# At the end of the process, the script provides the options with prefixes to fallbacks. 
 +# e.g. 
 +#   with_hdf5=/WORKSPACE_PREFIX/abinit-x.y.z/tmp-build/fallbacks/install_fb/vendor/version/hdf5/1.10.6 
 +
 +# You can link these fallbacks with Abinit by copying the options to your ac9 file. 
 cd .. cd ..
-../configure --prefix=/abinit/install/path \ +../configure --with-config-file="config.ac9
-  --with-fallbacks-prefix="/path/to/fallbacks/prefix\ +
-  ... options ... +
 make -j8   # For example, if you have at least 8 cores available make -j8   # For example, if you have at least 8 cores available
 make check make check
 make install make install
 </code> </code>
 +/* ../configure --prefix=/abinit/install/path \
 +*  --with-fallbacks-prefix="/path/to/fallbacks/prefix" \
 +*  ... options ... 
 +*/
  
-What happens in this case is that we first configure Abinit, so that it generates all the necessary information to build the fallbacks for missing external dependencies. The configure script of Abinit always gives priority to properly-installed external dependencies and will only select the minimal necessary fallbacks, in order to save time, trigger less bugs, and aim at maximum reliabilityAt this stage, the configure script has to failbecause it cannot anticipate the successful build of the fallbacks.+Once the information is available to the configure script of the fallbacks, we can build them within the Abinit source tree and install them outside.\\ 
 +NextAbinit uses them during its own build and we can install it normally after checking that everything is fine.\\ 
 +In further builds with the same compiler, the same fallbacks can be reused, i.e. no need to rebuild them.
  
-Once the information is available to the configure script of the fallbacks, we can build them within the Abinit source tree and install them outsideNext, Abinit uses them during its own build and we can install it normally after checking that everything is fine. In further builds with the same compiler, the same fallbacks can be reused, i.e. no need to rebuild them.+By default, the fallbacks are installed in "/WORKSPACE_PREFIX/abinit-x.y.z/tmp-build/fallbacks/install_fb".\\ 
 +The variable //fallbacks_prefix// can be changed in the //fallbacks/build-abinit-fallbacks.sh// script if you want to change the installation folder.\\ 
 +Please note that this path must be absolute, i.e. start with a slash\\
  
-One line must be changed in the //transient/build-abinit-fallbacks.sh// script for it to work. This script can indeed not guess where you want to install the fallbacks. This is why you have to replace the **PREFIX** keyword by the full installation path of your choice. Please note that this path must be absolute, i.e. start with a slash. The line to change is located at the top of the script: 
 <code bash> <code bash>
 +#!/bin/bash
 +
 +# Init
 +fallbacks_prefix="@abinit_builddir@/fallbacks/install_fb/@abi_fc_vendor@/@abi_fc_version@"
 +
 +...
 +</code>
 +
 +/* -------------------------------------------------------------------------------------------------
 +One line must be changed in the //transient/build-abinit-fallbacks.sh// script for it to work. This script can indeed not guess where you want to install the fallbacks. This is why you have to replace the **PREFIX** keyword by the full installation path of your choice. Please note that this path must be absolute, i.e. start with a slash. The line to change is located at the top of the script:
 +
 #!/bin/sh #!/bin/sh
  
Line 149: Line 177:
  
 ... ...
-</code>+*/
  
 ===== Using installed fallbacks ===== ===== Using installed fallbacks =====
Line 183: Line 211:
 .    .   
 </code> </code>
-where files are ordered by compiler vendor, then compiler version, and finally build variant. Each variant corresponds to a set of build parameters and is summarized by a keyword:+where files are ordered by compiler vendor (intel, gnu, nag,...), then compiler version, and finally build variant. Each variant corresponds to a set of build parameters and is summarized by a keyword:
   * //gpu// for a GPU-aware configuration;   * //gpu// for a GPU-aware configuration;
-  * //mpi// for a MPI-aware configuration;+  * //openmpi// or //mpich// for a MPI-aware configuration;
   * //omp// for an OpenMP-aware configuration;   * //omp// for an OpenMP-aware configuration;
   * //sdebug// for a serial configuration with enhanced debug flags;   * //sdebug// for a serial configuration with enhanced debug flags;
build/fallbacks.1597822298.txt.gz · Last modified: 2020/08/19 09:31 by Jean-Michel Beuken