Comments (8)
Could you please follow the steps posted at https://github.com/PrincetonUniversity/SPEC/wiki/Stellar-Compilation-Instructions and see if those instructions help?
from spec.
I got the Makefile setup for building the python wrapper to work again.
Here are the steps to reproduce this.
- Clone the latest state of Caoxiang's
f90wrap
and install it:git clone [email protected]:zhucaoxiang/f90wrap.git cd f90wrap pip install --user .
- I assume that you start from a clean clone of the SPEC repository on the
pywrap_makefile
branch:
git clone [email protected]:PrincetonUniversity/SPEC.git -b pywrap_makefile SPEC_pywrap_makefile
- Go into the
python_wrapper
directory:
cd SPEC_pywrap_makefile/Utilities/python_wrapper
- Build SPEC itself and the Python wrapper (make sure to adjust BUILD_ENV to your targeted machine):
make BUILD_ENV=gfortran_arch
At the end, the SPEC version should be printed:... lots of messages ... SPEC version: 3.1
- Check the setup:
- Check that the version output works on the command line:
python -c "from spec import spec; print('SPEC version: {:}'.format(spec.constants.version))"
- Check that SPEC can be run in stand-alone mode via the Python wrapper:
python spec/core.py ../../InputFiles/TestCases/G3V01L0Fi.001.sp
- Check that the first example (optimization) for the Python wrapper works:
python examples/example.py
- Check that the second example (iterative re-convergence) for the Python wrapper works:
OMP_NUM_THREADS=1 python examples/example_2.py
- Check that the version output works on the command line:
@abaillod @zhucaoxiang
Can you please check if this works on your machines as well?
from spec.
@mbkumar, I am not sure to fully understand your link, especially point 6. As I said, I am a beginner with cmake and I have no idea what I am doing when I modify these files. Anyway since the Makefile seems to be fixed I will work with that. I am happy to test the cmake on my machine though if needed!
@jonathanschilling , thanks for fixing the Makefile! I however had to do some changes so that it works on my machine. I did the following changes:
@@ -7,11 +7,11 @@ include ${SOURCES}/SPECfile
# define the compiler names
#=======================================================================
-CC = gcc
+#CC = gcc
# Fortran compiler
-F90 = gfortran
-#F90 = ifort
+#F90 = gfortran
+F90 = ifort
#F90 = /opt/intel/composer_xe_2015.3.187/bin/intel64/ifort
PYTHON = python3
@@ -28,16 +28,14 @@ ifeq ($(F90),gfortran)
endif
ifeq ($(F90),ifort)
- # gfortran f90wrap temp files only. not compilation
- FPP = gfortran -E
-
- FPP_F90FLAGS = -x f95-cpp-input -fPIC
-
- # use 1 and 0 for True and False
- F90FLAGS = -fpscomp logicals -fPIC
-
- # for f2py
- FCOMP = intelem
+ FPP = gfortran -E # gfortran f90wrap temp files only. not compilation
+ FPP_F90FLAGS = -x f95-cpp-input -fPIC
+ F90FLAGS = -fpscomp logicals -fPIC # use 1 and 0 for True and False
+ FCOMP = intelem # for f2py
+ LINKS=-L${MKLROOT}/lib/intel64 -lmkl_rt -lpthread -lm -ldl
+ LINKS+=-L$(HDF5_HOME)/lib -lhdf5_fortran -lhdf5 -lpthread -lz -lm
+ LINKS+=-L$(FFTW_DIR)/lib -lfftw3
+ LINKS+=-liomp5
endif
#=======================================================================
Then all the tests you propose were successful!
from spec.
@abaillod Great to hear that this setup works for you! Can you maybe modify the Makefile
in python_wrapper
in a similar way as done in the SPECfile
where flags are selected based on BUILD_ENV
so that we do not need to edit it all the time?
from spec.
@jonathanschilling @abaillod I pushed one commit to adopt the Intel compiler. Now, you can use something like make all BUILD_ENV=intel_stellar F90=ifort
.
But I do have a question testing python spec/core.py ../../InputFiles/TestCases/G3V01L0Fi.001.sp
, while I can run xspec
normally. I got the following error.
Invalid line in screenlist: Wpp00aa = T
readin : :
readin : ********** : Igeometry= 3 ; Istellsym= 1 ; Lreflect= 0 ;
readin : : Lfreebound= 0 ; phiedge= 2.000000000000000E+00 ; curtor= 1.038123580200000E-09 ; curpol= 0.000000000000000E+00 ;
readin : : gamma= 0.000000000000000E+00 ;
readin : : Nfp= 5 ; Nvol= 1 ; Mvol= 1 ; Mpol= 4 ; Ntor= 4 ;
readin : : pscale= 0.00000E+00 ; Ladiabatic= 0 ; Lconstraint= 0 ; mupf: tol,its= 1.00E-12 , 128 ;
readin : : Lrad = 8,
readin : :
readin : ********** : Linitialize= 0 ;LautoinitBn= 1 ; Lzerovac= 0 ; Ndiscrete= 2 ;
readin : : Nquad= -1 ; iMpol= -4 ; iNtor= -4 ;
readin : : Lsparse= 0 ; Lsvdiota= 0 ; imethod= 3 ; iorder= 2 ; iprecon= 1 ; iotatol= -1.00000E+00 ;
readin : : Lextrap= 0 ; Mregular= -1 ; Lrzaxis= 1 ; Ntoraxis= 3 ;
readin : :
readin : ********** : LBeltrami= 4 ; Linitgues= 1 ; Lmatsolver= 3 ; LGMRESprec= 1 ; NiterGMRES= 200 ; epsGMRES= 1.00000E-14 ; epsILU= 1.00000E-12 ;
readin : :
readin : ********** : Lfindzero= 2 ;
readin : : escale= 0.00000E+00 ; opsilon= 1.00000E+00 ; pcondense= 4.000 ; epsilon= 1.00000E+00 ; wpoloidal= 1.0000 ; upsilon= 1.00000E+00 ;
readin : : forcetol= 1.00000E-12 ; c05xmax= 1.00000E-06 ; c05xtol= 1.00000E-12 ; c05factor= 1.00000E-04 ; LreadGF= F ;
readin : : mfreeits= 0 ; gBntol= 1.00000E-06 ; gBnbld= 6.66000E-01 ;
readin : : vcasingeps= 1.00000E-12 ; vcasingtol= 1.00000E-08 ; vcasingits= 8 ; vcasingper= 1 ;
readin : :
readin : ********** : odetol= 1.00E-07 ; nPpts= 500 ;
readin : : LHevalues= F ; LHevectors= F ; LHmatrix= F ; Lperturbed= 0 ; dpp= -1 ; dqq= -1 ; dRZ= 1.00000000E-05 ; Lcheck= 0 ; Ltiming= F ;
readin : :
readin : : myid= 0 ; Rscale= 1.000000000000000E+01 ;
preset : : myid= 0 ; Mrad= 8 : Lrad= 8,
preset : ********** : LBsequad= F , LBnewton= F , LBlinear= T ;
preset : :
preset : ********** : Nquad= -1 ; mn= 41 ; NGdof= 0 ; NAdof= 361,
preset : :
preset : ********** : Nt= 32 ; Nz= 32 ; Ntz= 1024 ;
INTEL MKL ERROR: /opt/intel/oneapi/mkl/2021.1.1/lib/intel64/libmkl_avx512.so.1: undefined symbol: mkl_sparse_optimize_bsr_trsm_i8.
Intel MKL FATAL ERROR: Cannot load libmkl_avx512.so.1 or libmkl_def.so.1.
srun: error: stellar-k08n20: task 0: Exited with exit code 2
srun: launch/slurm: _step_signal: Terminating StepId=96299.0
The first line is interesting. It doesn't show in the xspec
execution. The error seems happening with a linking error, so there must be an error. Do you guys have any clue? (I think I might have some issues with my mpi4py
)
- I think Jonathan's fix breaks CMAKE that @mbkumar set up. My understanding is that the CMAKE system or the
steup.py
script is compiling a library/package namedspec
and put it in the/spec
folder. That's why it was usingimport spec.spec as spec
incore.py
. Right now, the import line is different. I haven't tested it on my side, but I guess thepython setup.py install
way doesn't work.
I didn't push a fix because a) I was waiting for the merge of my f90warp fork; b) a solution works for both Makefile and CMAKE. But I think we are really close. (Just use a consistent name on both sides).
from spec.
@zhucaoxiang I think we should keep the adjusted name of the auto-generated Python wrapper as "spec_f90wrapped".
Otherwise, I feel that we have too many slightly different items named "spec" in this setup.
@mbkumar Can you adjust the CMake setup to use this different name?
from spec.
from spec.
This issue has been solved on my machine thanks to the recent fixes proposed by @jonathanschilling. I am closing it!
from spec.
Related Issues (20)
- GMRES error HOT 10
- Segmentation faults when compiled with cmake HOT 6
- Problem with master branch HOT 4
- Issue when restarting from .end file HOT 6
- Help needed to install python wrappers HOT 15
- Wrapper will not compile (reserved python words?) HOT 3
- Problem running tests on master branch HOT 3
- python_wrapper Makefile setup HOT 2
- Question about force-gradient HOT 4
- Bug in force gradient when Lrzaxis=1 ?
- MATLAB metric subroutine needs fix HOT 2
- Python wrapper compilation for Henneberg representation branch HOT 2
- VMEC initializer HOT 2
- Read initial guess with python wrappers HOT 5
- Cannot install f90wrap HOT 7
- Question about matrix free method HOT 2
- SPEC license? HOT 5
- Installation on mac m1 HOT 16
- py_spec installation is borken HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spec.