In case it's helpful to others, this is what I wound up with for the %build 
section of my spec file. So far it seems to work pretty well.

#Building requires cmake
module load cmake

# Use MKL for Intel
%if "%is_intel" == "1"
module load mkl

cat > Make.user<<EOF
USEICC = 1
USEIFC = 1
USE_INTEL_MKL = 1
USE_INTEL_MKL_FFT = 1
USE_INTEL_LIBM = 1
EOF
%endif

#Add this line for all builds
cat >> Make.user<<EOF
prefix=%{INSTALL_DIR}
EOF

#Build
make -j

#Install to prefix
make install DESTDIR="$RPM_BUILD_ROOT"


#Add some packages (plotting) to the build
module load python
export JULIA_PKGDIR="$RPM_BUILD_ROOT/%{INSTALL_DIR}/share/julia/site"
echo '                                 
Pkg.init();
Pkg.add("PyPlot");
Pkg.add("Gadfly");
' | $RPM_BUILD_ROOT/%{INSTALL_DIR}/bin/julia

#Make symlink relative (or else rpmbuild fails)
cd $RPM_BUILD_ROOT/%{INSTALL_DIR}/share/julia/site/v0.4
rm .cache
ln -s ../.cache .cache

Reply via email to