You are not logged in.

#1 2015-10-08 14:34:29

grombindal
Member
From: Grenoble, France
Registered: 2015-10-08
Posts: 3

Trying to install libcmatrixR3

Hello everyone,

I am trying to install libcmatrixR3-lite on my system but as far as today I am unsuccessfull. I followed the steps in the install.txt file but I must miss something because I always got the same error message.

Here are all the messages displayed while I try to run the "make" command

g++ -I/home/loic/libcmatrixR3/include -DLCM_SUPPRESS_VIEWS -DLCM_DISABLE_IMPLICIT_COMPLEX -Wall -Wno-sign-compare -c -g -O3 -DNDEBUG -o coredefs/rmatrix.o coredefs/rmatrix.cc
In file included from /home/loic/libcmatrixR3/include/BaseList.h:4:0,
                 from /home/loic/libcmatrixR3/include/List.h:5,
                 from /home/loic/libcmatrixR3/include/Matrix.h:4,
                 from /home/loic/libcmatrixR3/include/rmatrix.h:7,
                 from coredefs/rmatrix.cc:1:
/home/loic/libcmatrixR3/include/basedefs.h: Dans la fonction membre statique ‘static void libcmatrix::Multiply_<2ul, 2ul, 2ul>::func(T1&, const T2&, const T3&)’:
/home/loic/libcmatrixR3/include/basedefs.h:1722:25: attention : typedef ‘a_type’ locally defined but not used [-Wunused-local-typedefs]
     typedef LCM_VAL(T2) a_type;
                         ^
/home/loic/libcmatrixR3/include/basedefs.h:1723:25: attention : typedef ‘b_type’ locally defined but not used [-Wunused-local-typedefs]
     typedef LCM_VAL(T3) b_type;
                         ^
/home/loic/libcmatrixR3/include/basedefs.h : dans l'instantiation de ‘bool libcmatrix::checksnonzero_tolerance<T>::operator()(T) const [with T = double]’ :
coredefs/rmatrix.cc:27:30:   required from here
/home/loic/libcmatrixR3/include/basedefs.h:752:46: erreur: ‘fabs’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
     bool operator()(T a) const { return (fabs(a)>tol_); }
                                              ^
In file included from /usr/include/features.h:365:0,
                 from /usr/include/assert.h:35,
                 from /usr/include/c++/5.2.0/cassert:43,
                 from /home/loic/libcmatrixR3/include/List.h:4,
                 from /home/loic/libcmatrixR3/include/Matrix.h:4,
                 from /home/loic/libcmatrixR3/include/rmatrix.h:7,
                 from coredefs/rmatrix.cc:1:
/usr/include/bits/mathcalls.h:181:1: note: ‘double fabs(double)’ declared here, later in the translation unit
 __MATHCALLX (fabs,, (_Mdouble_ __x), (__const__));
 ^
Makefile:60 : la recette pour la cible « coredefs/rmatrix.o » a échouée
make: *** [coredefs/rmatrix.o] Erreur 1

And here is the makefile:

# Generated by configure from Makefile.in
# Avoid editing this file directly
# Makefile for libcmatrix

CPPFLAGS= -I/home/loic/libcmatrixR3/include -DLCM_SUPPRESS_VIEWS -DLCM_DISABLE_IMPLICIT_COMPLEX
CXX=g++
CXXFLAGS= -Wall -Wno-sign-compare
RANLIB=ranlib
# flags for optimisation
OPTFLAGS=-O2
# method to create archive
AR=ar ru

# You shouldn't need to alter anything below here

COMPILE=$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c
ALLOPTFLAGS=$(OPTFLAGS) -DNDEBUG

LOCALOBJS= local/CrystalSystem.o local/CrystalGeneric.o local/MoleculeStructure.o
COREOBJS= coredefs/complex.o coredefs/common.o coredefs/diagonal.o coredefs/diagonalise.o coredefs/power.o coredefs/invert.o coredefs/transforms.o coredefs/blocking.o coredefs/mixed.o coredefs/realtransforms.o coredefs/Chebyshev.o
UNSAFEOBJS= coredefs/cmatrix.o utils/statstuff.o coredefs/rmatrix.o NMR/MetaPropagation.o NMR/Sequence.o
UTILSOBJS= utils/ft.o utils/geometry.o utils/Lineshapes.o
OPTIMOBJS= optim/simplex.o optim/levmarq.o optim/constraints.o
NMROBJS= NMR/space_T.o NMR/wigner.o NMR/MAS.o NMR/InhomoMAS.o NMR/nonsecular.o NMR/proc.o NMR/superop.o NMR/HomoPropTD.o NMR/HomoPropFD.o NMR/InhomoProp.o NMR/StaticProp.o NMR/AsynchronousProp.o NMR/PhaseModulatedPropagator.o NMR/InversionGenerator.o
NONOPTOBJS = coredefs/writematrix-n.o coredefs/readmatrix-n.o utils/matlabio-n.o utils/readmatlabio-n.o utils/matlabcomposite-n.o utils/ttyio-n.o utils/timer-n.o NMR/spin_system-n.o  NMR/powder-n.o NMR/basespin_system-n.o NMR/NMR-n.o NMR/tensorop-n.o NMR/spinhalf_system-n.o utils/simpsonio-n.o
ALWAYSDEBUGOBJS = coredefs/common_g.o
#@MINUITOBJS@

ALLSAFEOBJS= $(COREOBJS) $(UTILSOBJS) $(NMROBJS) $(OPTIMOBJS) utils/Fork_controller.o 
ALLOBJS= $(UNSAFEOBJS) $(ALLSAFEOBJS) 

ALLNORMOBJS=$(ALLOBJS) $(NONOPTOBJS) $(ALWAYSDEBUGOBJS)
ALLPROFOBJS=$(ALLOBJS:.o=_p.o) $(NONOPTOBJS) $(ALWAYSDEBUGOBJS)
ALLGOBJS=$(ALLOBJS:.o=-g.o) $(NONOPTOBJS:-n.o=-g.o) $(ALWAYSDEBUGOBJS)
ALLTHROBJS=$(UNSAFEOBJS:.o=_r.o) $(ALLSAFEOBJS)

ROOT=..

first: lib/libcmatrix.a

#%.o: %.f
#	@F77@ @FFLAGS@ -c -o $@ $<

%_p.o: %.cc
	$(COMPILE) $(ALLOPTFLAGS) -pg -o $@ $<

%_g.o: %_g.cc
	$(COMPILE) -g -o $@ $<

%-g.o: %.cc
	$(COMPILE) -g -o $@ $<

%-n.o: %.cc
	$(COMPILE) -DNDEBUG -o $@ $<

%_r.o: %.cc
	$(COMPILE) $(ALLOPTFLAGS)  -DLCM_REENTRANT -o $@ $<

%.o: %.cc
	$(COMPILE) $(ALLOPTFLAGS) -o $@ $<

# clean up template repositories
tempclean:
#	-@CLEAN@
#	-cd coredefs; @CLEAN@
#	-cd utils; @CLEAN@
#	-cd NMR; @CLEAN@
#	-cd optim; @CLEAN@
#	-cd local; @CLEAN@

lib/libcmatrix.a: $(ALLNORMOBJS)
	$(AR) $@ $(ALLNORMOBJS)
	chmod a+rx $@
	$(RANLIB) $@

lib/libcmatrix_p.a: $(ALLPROFOBJS)
	$(AR)  $@ $(ALLPROFOBJS)
	chmod a+rx $@
	$(RANLIB) $@

lib/libcmatrix-g.a: $(ALLGOBJS)
	$(AR)  $@  $(ALLGOBJS)
	chmod a+rx $@
	$(RANLIB) $@

lib/libcmatrix_r.a: $(ALLTHROBJS)
	$(AR)  $@ $(ALLTHROBJS)
	chmod a+rx $@
	$(RANLIB) $@

libcmatrixR3.tar.gz:
	cd $(ROOT) ; tar --exclude lib/* --exclude *.o --exclude=*~ --exclude=Makefile --exclude=include/config.h --exclude=config.status -cvf libcmatrixR3.tar libcmatrixR3
	-rm $(ROOT)/libcmatrixR3.tar.gz
	gzip $(ROOT)/libcmatrixR3.tar

libcmatrixR3_lite.tar.gz:
	cd $(ROOT) ; tar --exclude lib/* --exclude=*~ --exclude=Makefile --exclude=include/config.h --exclude=config.status  --exclude=local -cvf libcmatrixR3_lite.tar libcmatrixR3
	-rm $(ROOT)/libcmatrixR3_lite.tar.gz
	gzip $(ROOT)/libcmatrixR3_lite.tar

archives: distclean libcmatrixR3.tar.gz libcmatrixR3_lite.tar.gz

normclean: tempclean
	-rm lib/libcmatrix.a $(ALLOBJS)

pclean: tempclean
	-rm lib/libcmatrix_p.a $(ALLPROFOBJS)

gclean: tempclean
	-rm lib/libcmatrix-g.a $(ALLGOBJS)

rclean: tempclean
	-rm lib/libcmatrix_r.a $(ALLTHROBJS)

testclean:
	-cd test; make clean

docclean:
	-cd docs; rm *.dvi *.log *.ilg

clean: tempclean pclean gclean rclean testclean docclean
	-rm -r *.cache config.log	

distclean: tempclean
	-rm $(ALLOBJS) $(ALLPROFOBJS) $(ALLGOBJS) $(ALLTHROBJS)
	-rm -r test/Makefile Makefile_template .make.* *.cache config.log

all: lib/libcmatrix.a lib/libcmatrix-g.a 

I have almost no clue of how a makefile works and the error message is not giving me many informations so if someone as any idea of what the problem might be please help me.

Thanks!

Offline

#2 2015-10-08 15:47:12

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,804

Re: Trying to install libcmatrixR3

Hi, and welcome to Arch Linux.

Sadly I don't understand French, but I do understand most of that output.  You might want to try the suggestions here to get output in English.
I looked around in the AUR and did not see anything providing that library sad 
Do you have a link to the project site?  I may have time to give this a try when I get home tonight.

Totally off topic -- my French speaking daughter spent the summer in your beautiful city.  She fell in love with it and spent much of her free time hiking the Alps; I fret she may want to move back there after she finishes school.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2015-10-09 10:28:59

grombindal
Member
From: Grenoble, France
Registered: 2015-10-08
Posts: 3

Re: Trying to install libcmatrixR3

Sorry for the french, I spend most of my time switching between french and english for work so I usually do not even make the difference when I am reading.

Here are the messages in english:

g++ -I/home/loic/libcmatrixR3/include -DLCM_SUPPRESS_VIEWS -DLCM_DISABLE_IMPLICIT_COMPLEX -Wall -Wno-sign-compare -c -O2 -DNDEBUG -o coredefs/rmatrix.o coredefs/rmatrix.cc
In file included from /home/loic/libcmatrixR3/include/BaseList.h:4:0,
                 from /home/loic/libcmatrixR3/include/List.h:5,
                 from /home/loic/libcmatrixR3/include/Matrix.h:4,
                 from /home/loic/libcmatrixR3/include/rmatrix.h:7,
                 from coredefs/rmatrix.cc:1:
/home/loic/libcmatrixR3/include/basedefs.h: In static member function 'static void libcmatrix::Multiply_<2ul, 2ul, 2ul>::func(T1&, const T2&, const T3&)':
/home/loic/libcmatrixR3/include/basedefs.h:1722:25: warning: typedef 'a_type' locally defined but not used [-Wunused-local-typedefs]
     typedef LCM_VAL(T2) a_type;
                         ^
/home/loic/libcmatrixR3/include/basedefs.h:1723:25: warning: typedef 'b_type' locally defined but not used [-Wunused-local-typedefs]
     typedef LCM_VAL(T3) b_type;
                         ^
/home/loic/libcmatrixR3/include/basedefs.h: In instantiation of 'bool libcmatrix::checksnonzero_tolerance<T>::operator()(T) const [with T = double]':
coredefs/rmatrix.cc:27:30:   required from here
/home/loic/libcmatrixR3/include/basedefs.h:752:46: error: 'fabs' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
     bool operator()(T a) const { return (fabs(a)>tol_); }
                                              ^
In file included from /usr/include/features.h:365:0,
                 from /usr/include/assert.h:35,
                 from /usr/include/c++/5.2.0/cassert:43,
                 from /home/loic/libcmatrixR3/include/List.h:4,
                 from /home/loic/libcmatrixR3/include/Matrix.h:4,
                 from /home/loic/libcmatrixR3/include/rmatrix.h:7,
                 from coredefs/rmatrix.cc:1:
/usr/include/bits/mathcalls.h:181:1: note: 'double fabs(double)' declared here, later in the translation unit
 __MATHCALLX (fabs,, (_Mdouble_ __x), (__const__));
 ^
Makefile:60: recipe for target 'coredefs/rmatrix.o' failed
make: *** [coredefs/rmatrix.o] Error 1

So I need this library to install GSIm: http://sourceforge.net/projects/gsim/ and here is the link where I got the library  https://www.dur.ac.uk/solids.nmr/software/pnmrsim/. I also found nothing on the AUR.

Off topic: The surroundings of the city are really beautifull and if she likes skiing this city is also the perfect place in winter. Personnally I prefer living in the USA, I spent one year there and I think American people are much nicer than the French ones.

Offline

#4 2015-10-09 18:22:38

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,804

Re: Trying to install libcmatrixR3

The error you encountered was easy to get past.   Just include "math.h".    But, how did the author compile it?  Perhaps a different compiler?

Regardless, that led to more errors having to do with template hell.   This is not going to be easy sad


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#5 2015-10-13 07:58:06

grombindal
Member
From: Grenoble, France
Registered: 2015-10-08
Posts: 3

Re: Trying to install libcmatrixR3

Thanks,

If this might help I give you the install.txt file that was with the library

This release of libcmatrix is intended to work with any Unix-derived operating system and an ANSI C++ compiler.  That said, the heavy use of complex templates means that not all compilers are up to the job...

g++ V3.4 or V4 are strongly recommended.  libcmatrix does push C++ templates to their limit (though not beyond the ANSI standard).  Unfortunately some compilers don't cope well with this e.g. g++ V3.3 incorrectly reports a "ambiguous class template" error.

The configure script will almost certainly need tweaking for other compilers / Unices.  

Windows:
The library will always compile under Cygwin and should compile under the more restricted MingW environment (specify -mno-cygwin to gcc).  The MingW version is actually recommended as there seems to a large overhead associated with the C++ exception handling under Cygwin.

N.B. There appears to a compiler bug affecting gcc 3.4 under Cygwin; try turning down optimisation to -O1 if unexpected core dumps are encountered


1. Configuration
./configure
will run the autoconf script which creates Makefile, config.h, Makefile_template and test/Makefile
as a function of the system configuration.  Rather than tinker with the Makefiles produced, you should alter
compiler flags etc. by passing environment variables to configure e.g.
 setenv CXXFLAGS -g +w2
to set C++ compiler options (csh).  For the Bourne shell and variants use something like
CXX=g++ CXXFLAGS="-g +w2" ./configure
  
Recommended options (for optimisation):
g++: -g -O3  [-W -Wno-sign-compare options are added automatically if gcc is being used ]

Optional components:

"--with-atlas" on the configure command line enables use of the ATLAS
libraries for fast matrix multiplication etc. (recommended if, but only if,
dealing with relatively large spin systems).  By default, ATLAS is included if
it can found.  Use "--without-atlas" to explicitly disable ATLAS.

The location of the header and library files must be set in these are not already in the compile/link path e.g.

CPPFLAGS="-I<atlasdir>/include" LDFLAGS="-L<atlasdir>/lib/<arch>" ./configure

where <atlasdir> is the location of the ATLAS root directory and
<arch> is the "architecture" for which ATLAS has been configured.
If the library has been compiled with ATLAS, then all programs 
that use the library must be compiled with ATLAS.


"--with-acml" ACML is an alternative to ATLAS for AMD-based processors.
Same considerations as --with-atlas (except it is not enabled by default)


"--with-threads" enables use of multi-threading.  A special version 
of library libcmatrix_r.a must be compiled, together with appropriate
options when compiling (see Makefile_template).  NB. Multi-threading
is not being actively developed/verified.  MPI (see below) is
a simpler option in most cases.

"--with-MPI" enables use of the Message Passing Interface (MPI).
mpi.h and -lmpi must be accessible for this to work.

"--with-minuit" enables Minuit support.  If --with or --without is not set explicitly, it is automatically included if the appropriate files are found. 

The configuration script first checks for the current API (Minuit2) but will work with the older C++ Minuit API if found.

Check the configuration options in config.h but be sure you know what you are doing before changing anything!

Note that you can recreate the Makefile's etc. after edits of say config.h without re-running configure by running config.status.

2. make libmatrix.a 
will create the libcmatrix.a library.

or use make all to make all versions of the library e.g. libcmatrix_r.a variant which should be used for multi-threading programs.  Other variants exist for debugging (-g) and profiling (-pg).  


If only compiling libcmatrix for linking with other programs such as pNMRsim, stop here.

No install script is currently supplied since libcmatrix is often only temporarily required for pNMRsim compilation.  If preferred, however, the contents of lib and include can be installed in say /usr/local.


3. Testing
'make all' in the test subdirectory which will create a set of test programs.
These are mostly demonstrations of different aspects of the library rather than real stress tests.  Many programs require input; comments in the .cc
files should give suitable values.  Don't worry if not all the programs compile - the libcmatrix API currently evolves for best interaction with pNMRsim and so the "standalone" interface is not so well defined.

It is a good idea to check the performance of key operations
such a matrix multiplication to ensure that appropriate "tuning"
options have been selected.  The "testops" programs determines
the floating point "throughput" (in megaflops/s) of various
operations as a function of matrix size.  The peak performance
should be of the same order as the CPU clock speed.


4. Read the documentation in docs!

paul.hodgkinson@durham.ac.uk



*** Info below is old and may have lost any relevance ***

There appears to be an error in the header files
supplied with g++ (< V3?) which means that necessary features of the ANSI library
are disabled...  Fixing this requires modifying the stl_config.h file which
configures the STL for g++ - not something you should not do lightly...
Around line 164, comment out the line
#define __STL_NO_NAMESPACES

Sun Workshop/Forte CC: -fast -xO4 -fsimple=1  [ N.B. The aggressive -fsimple=2 can
upset some delicate algorithms ]  [ Compatibility of the current release and the the Sun compilers hasn't been tested. ]

Note that for optimal performance using gcc on the Sun, you need to tell configure
where to find the fast and sunmath (for sincos) libraries.  Search for sunmath.h
and libsunmath.a in the /opt/SUNWspro heirarchy (assuming you have the Sun compilers!).
Then add "-I/opt/SUNWspro/<include dir>" to CPPFLAGS and  "-L/opt/SUNWspro/<library dir>" to LDFLAGS before running configure.

Offline

Board footer

Powered by FluxBB