compiling a local version of cmiss on a Xeon machine
Compiling cmiss on a Xeon 64 bit machine.
The machine type: x86_64
The Xeon 64 that I am compiling is intrinsicly a 64 bit machine and emiulates a 32 bit machines for 32bit code.
When compiling cmiss on such a machine you will need 64 bit perl and you will neet to define CMISS64_PERL pointing to the perl file along with your other cmiss variable.
Currently compiling cmiss using the standard make files will run g77 fotran compilers, which todat e do not handle OpenMP. You will need to get buy, lay your hands on another compiler to do this.
Karl says: "The compilers I would expect to perform best are Intel and PathScale (EKOPath). If neither of these work then it may be worth trying the Portland compilers."
I was able to compile cmiss with g77 and gcc for serial versions, these also solved a basic cellml activation problem.
So I am now running with Intel compilers to try and get OMP working.
to find out if you to have ifort try icc -v and ifort -v if you get a response then you are in luck
- if these files are on your machine then you can try adding
- if ( -r "/opt/intel/idbe/9.1.033/bin/idbvars.csh" ) then
- source /opt/intel/idbe/9.1.033/bin/idbvars.csh
endif if ( -r "/opt/intel/fce/9.1.033/bin/ifortvars.csh" ) then
source /opt/intel/fce/9.1.033/bin/ifortvars.csh
endif if ( -r "/opt/intel/cce/9.1.033/bin/iccvars.csh" ) then
source /opt/intel/cce/9.1.033/bin/iccvars.csh
endif
to your start up file.
Where is ifort referecned currently? Currently a grep of the cmiss directory shows ifort references in: nz_cmiss/cm/Makefile nz_cmiss/linear_solvers/Makefile.inc
But these are not currently used when on x86_64 machines only ia64 machines.
A quick alteration of the respective makefiles changing ifneq ($(filter $(INSTRUCTION),ia64),) to ifneq ($(filter $(INSTRUCTION),ia64 x86_64),)
and trying to build debug serial cm leads to:
build debug serial cmiss: cm build fails with: gcc -o dso/x86_64-linux-debug/libfedef.so.build -shared generated/x86_64-linux-debug/fedef.olist /usr/bin/ld: skipping incompatible generated/x86_64-linux-debug/data_objects/constant/CONSTANT00.o when searching for generated/x86_64-linux-debug/data_objects/constant/CONSTANT00.o /usr/bin/ld: cannot find generated/x86_64-linux-debug/data_objects/constant/CONSTANT00.o
If you have this error it is quite possible that you are using the 32 bit version of your compiler instead of your 64 bit version. Have a look in /opt/intel/ and see if there is fc and fce. fce in my case is the 64 bit version and that is the one you want to be using.
Next error:
gcc4 -o dso/x86_64-linux-debug/libfedef.so.build -shared generated/x86_64-linux-debug/fedef.olist /usr/bin/ld: generated/x86_64-linux-debug/feinterpreter/GET_INTERPRETER_PTR_FROM_COMM00.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC generated/x86_64-linux-debug/feinterpreter/GET_INTERPRETER_PTR_FROM_COMM00.o: could not read symbols: Bad value
Change the make file to include
DBGF_FLGS =+ -fPIC
when using ifort. I also hard coded (probably a bad idea) in the location of perl64 in the perl_interp make file and rebuilt it.
I was then able to make cm debug and cm opt
running a simple activation problem leads to: when reading in a node file >>ERROR: >> Error : Iostat = 64
>OPEN_FILE >DENODS >FEM_DYNAM >FEM >SYNTAX >PARSE >EXECUTE_COMMAND
ERROR: Error in cmiss command "fem define node;r;$example/geom/plate;".
>INTERPRET_COMMAND_LINE >READCOM >SYNTAX >PARSE >EXECUTE_COMMAND
ERROR: Error in cmiss command "read command;Plate_imp.com".
>INTERPRET_COMMAND_LIN
Does commenting out the UNLINK_FILE call in cm/source/fe10_linux/OPENF.f work around this? If not IOSTAT numbers should be documented in the ifort documentation.
It appears that CMISSCELLML.cpp will also need to be changed as it useses g77 for linux builds.
According to Karl this is not the case g77 will link with ifort and
gx does not compile
it requries two files libXm.a and libMrm.a find these on your system with: find / -name libXm.a copy these files to lib/x86_64-linux/ int the gx directory gx should then compile.
Further errors in debug cmiss for lsoda and sqp errors of the sort: : undefined reference to ???
this can be fixed by using ifort compilers with lsoda and sqp for lsoda I added in
- ifneq (,$(shell icc -V 2>&1 | grep -i intel))
- CC = icc
endif ifneq (,$(shell ifort -V 2>&1 | grep -i intel))
FC = ifort FFLAGS += -fPICendif
to make sure I was using the correct compiler
- and
- FFLAGS += -W1 -w95 -cm -80 -auto -stack_temps -xP DBGCF_FLGS += -traceback -O0 -check format OPTCF_FLGS = -O3
to cover the flags. This seemed to get rid of most of the errors.
Rebuilding cmiss debug comes up with the error
/home/users/physiome/san/chris_cmiss//gx/lib/x86_64-linux/libgx.a(fortran_utils.o)(.text+0xa7): In function `stringlength_': : undefined reference to `s_cmp'
adding: g2c to DYNAMIC_LIBRARIES (as is doen for ATLAS and ACML)
fixed this problem, (thanks karl)
it all now builds.
cmgui gave me a ton of erros so i copied the executable from /hpc and was done.
Cmiss examples that do not work with linux -x86_64 (steve build)
Example 5521: Passive inflation and active contraction of a trilinear prolate spheroid Failed cm and cm-debug (fails on auckland build)
=>__Example 5533: Isovolumic contraction/ejection of a high order prolate model with two wall elements =>__ cm-debug only (works on auckland build)
=>__Example 5535: Passive inflation/isovolumic contraction of a trilinear prolate spheroid with varying fibre angles =>__Failed cm and cm-debug (works on auckland build) by work auckland mean generates the same incorrect answeres this example failes to converge and may not be a great test example
Example 5d2: The old (Gauss point based) approach to active tension modelling Failed cm and cm-debug (fails on auckland build)
=>__Example 7183: Estimating material parameters of in-vivo human skin =>__Failed cm and cm-debug (works on auckland build)
Example 723: Nonlinear material parameter optimisation with foward solving Failed cm and cm-debug (fails on auckland build)
=>__Example 724: Parameter estimation by minimising sums of squares of data errors =>__Failed cm and cm-debug (works on auckland build)
Example 726: Material parameter estimation with an orthotropic Criscione material law through the CellMl environment for simple shear with forward solve Failed cm and cm-debug (fails on auckland build)
Example 811b: Porcine ventricular model Failed cm and cm-debug (fails on auckland build)
Example 91: Inert gas mixing in a symmetric conducting + multi-branching respiratory model Failed cm and cm-debug (fails on auckland build)
Example 92: Gas mixing in a symmetric conducting/LPM respiratory model Failed cm-debug (fails on auckland build)
Example 95: Simulating water and heat transfer in a central airway model Failed cm and cm-debug (fails on auckland build)
Example 96: Simulating water and heat transfer in a full lung model Failed cm and cm-debug (fails on auckland build)
=>__Example 9812: Generating a 2D Voronoi capillary mesh over a 3D alveolar mesh =>__Failed cm and cm-debug (works on auckland build)
=>__Example 9813: Solving blood flow & blood cell distributions in a pulmonary capillary network =>__Failed cm and cm-debug (works on auckland build)
=>__Example b211x: Simple 2d simulation using Grid based FEM and AMG solver =>__Failed cm and cm-debug (works on auckland build)
=>__Example b212e: Implicit 2D Cubic Ionic Activation (bidomain) using Grid-based FE solving with AMG =>__Failed cm and cm-debug (works on auckland build)
=>__Example e6: Forward/inverse calculations on a 2D slice =>__Failed cm and cm-debug (works on auckland build)
=>__Example e7: Applying Noise and Manipulating Signals =>__Failed cm and cm-debug (works on auckland build)
Example e9 15,21,22,24,32,42 failed Example ea b failed
=>__Example eb: 2d torso slice (6 regions) solving x2-y2 =>__Failed cm and cm-debug (works on auckland build)
=>__Example ec: Hanging node test =>__Failed cm and cm-debug (works on auckland build)
Tips and tricks,
when cmiss is compiling in mp debug mode gcc is used and is flaged with the MP flag -openmp.
This seams to be ok in opt mode but in debug mp mode it causes problems and .o files compiled with gcc are not found.
I have emailed Karl to create MP_FLG for c and fortran compilers.
In the mean time for the hard fast work around types you can simply copy and paste the failed gcc compile line and remove the openmp flag compile the object manually and then restart cm complie this will (eventually) allow you to overcome this problem