-
Notifications
You must be signed in to change notification settings - Fork 114
Closed
Labels
easyDifficulty level is easy and good for starting into this projectDifficulty level is easy and good for starting into this projectenhancementNew feature or requestNew feature or request
Description
Build systems like CMake and meson can read the compiler from the FC
and CC
environment variables or detect the archiver from the AR
environment variable. Similarly the FFLAGS
and CFLAGS
variables can be used to pass flags for the compilation.
For example, below are environment variables usually set in a conda-build process:
ADDR2LINE=$BUILD_PREFIX/bin/x86_64-conda-linux-gnu-addr2line
AR=$BUILD_PREFIX/bin/x86_64-conda-linux-gnu-ar
AS=$BUILD_PREFIX/bin/x86_64-conda-linux-gnu-as
CXXFILT=$BUILD_PREFIX/bin/x86_64-conda-linux-gnu-c++filt
CC=$BUILD_PREFIX/bin/x86_64-conda-linux-gnu-cc
CFLAGS=-march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem $PREFIX/include -fdebug-prefix-map=$SRC_DIR=/usr/local/src/conda/fpm-0.3.0 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix
CPPFLAGS=-DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem $PREFIX/include
CPP=$BUILD_PREFIX/bin/x86_64-conda-linux-gnu-cpp
# ...
LDFLAGS=-Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,-rpath,$PREFIX/lib -Wl,-rpath-link,$PREFIX/lib -L$PREFIX/lib
INFO: activate-gfortran_linux-64.sh made the following environmental changes:
F77=$BUILD_PREFIX/bin/x86_64-conda-linux-gnu-gfortran
F90=$BUILD_PREFIX/bin/x86_64-conda-linux-gnu-gfortran
F95=$BUILD_PREFIX/bin/x86_64-conda-linux-gnu-f95
FC=$BUILD_PREFIX/bin/x86_64-conda-linux-gnu-gfortran
FFLAGS=-fopenmp -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem $PREFIX/include -fdebug-prefix-map=$SRC_DIR=/usr/local/src/conda/fpm-0.3.0 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix
FORTRANFLAGS=-fopenmp -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem $PREFIX/include -fdebug-prefix-map=$SRC_DIR=/usr/local/src/conda/fpm-0.3.0 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix
GFORTRAN=$BUILD_PREFIX/bin/x86_64-conda-linux-gnu-gfortran
Automatically picking up some of this information would reduce the packaging of any fpm project for conda to just:
fpm install --prefix $PREFIX
LKedward
Metadata
Metadata
Assignees
Labels
easyDifficulty level is easy and good for starting into this projectDifficulty level is easy and good for starting into this projectenhancementNew feature or requestNew feature or request