Personal tools
You are here: Home Forum Extension of the platform CalculiX to SALOME interface program

CalculiX to SALOME interface program

Up to Extension of the platform

CalculiX to SALOME interface program

Posted by bernhardi at January 09. 2011
Hi everybody, I attach a small program which can be used to translate CalculiX .frd files to .med files which can be imported into SALOME-PostPro. I have run several examples with it, including larger ones, on a Suse Linux 64 bit machine. It comes without any warranty, however I hope it will perhaps be useful to someone... There certainly will still be lots of bugs in it! I attach the code and a Makefile. PLease edit the Makefile in order to configure it to your system. The program will be linked to the HDF5 and MED libraries; therefore, you must first install these libraries into proper locations (for example, /usr/local/lib) and issue an ldconfig command before trying to compile calmed6.c. There are no element sets or node sets on the CalculiX .frd file; thus these sets are not translated. Usage: Assume you have done a CalculiX analysis with results file test.frd. Then, issue a /calmed6 test without extension .frd! Calmed6 should then generate a file test.MED which can be imported into SALOME-PostPro using the import > medfile feature.
Attachments

Re: CalculiX to SALOME interface program

Posted by JMB at January 11. 2011

Hello berhardi,

I have always appreciated your efforts at making the pathway between CalculiX and Salome/CodeAster easier.  I commend your contribution and work.   I have a question and a request.  Would it be possible for you to port the code to Python?  The reason for my request is, it will enable one to easily create a plug-in for Salome, if it were in Python.  Also I have had trouble trying to compile C / C++ code in the past and felt that Python is easier to digest.  However I realize the many benefits of C/C++ in terms of speed and code compatibility.  Let me know if this would possible.  I apologize if this seems too audacious a request!

Regards, JMB

Re: CalculiX to SALOME interface program

Posted by bernhardi at January 12. 2011
Hi JMB, thanks for your comment. My belief is that a python translation will not make too much sense because the programs have to be linked against HDF and MED. Speed is also an issue, in particular when it comes to the sorting out of the element surfaces in medaba for loading definitions. Perhaps we could call the entire C programs from python; calling C from python should be no problem. Outcome will then be a salome module that acts like a wrapper around the interface routines. -- If anybody has problems with linking against the libraries, please let me know your email adress; I then send statically loaded binaries that have (almost) everything included. The binary files are, however, to large (5MB each) to be posted here. Best regards, Bernhardi.

Re: CalculiX to SALOME interface program

Posted by JMB at August 08. 2011

Hello bernhardi,

Would you kindly, post some notes on how to compile the above program (calmed6.c)?

I tried using the sources of hdf5-1.6.9 and med-2.3.6 from aster-full-src-10.3.0-3.noarch.tar.gz, but to no avail.  I am running into all kinds of roadblocks in getting the appropriate pre-requisites , libraries, headers, etc. set right.  I have posted below my attempt.  Thank you.

Regards, JMB

cp ~/MyFiles/Download/CodeAster-Salome/aster-full-src-10.3.0-3.noarch.tar.gz /tmp
cd /tmp
gunzip -cd aster-full-src-10.3.0-3.noarch.tar.gz | tar -xvf -
cd /tmp/aster-full-src-10.3.0/SRC/
gunzip -cd hdf5-1.6.9.tar.gz | tar -xvf -
cd /tmp/aster-full-src-10.3.0/SRC/hdf5-1.6.9
./configure
make
make install
# ... < deleted for brevity > ...
# Libraries have been installed in:
#    /tmp/aster-full-src-10.3.0/SRC/hdf5-1.6.9/hdf5/lib
#
# If you ever happen to want to link against installed libraries
# in a given directory, LIBDIR, you must either use libtool, and
# specify the full pathname of the library, or use the `-LLIBDIR'
# flag during linking and do at least one of the following:
#    - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
#      during execution
#    - add LIBDIR to the `LD_RUN_PATH' environment variable
#      during linking
#    - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
#    - have your system administrator add LIBDIR to `/etc/ld.so.conf'

gunzip -cd med-2.3.6.tar.gz | tar -xvf -
cd /tmp/aster-full-src-10.3.0/SRC/med-2.3.6
./configure --with-hdf5=/tmp/aster-full-src-10.3.0/SRC/hdf5-1.6.9/hdf5/
make
make check
sudo make install
# ... < deleted for brevity > ...
# Libraries have been installed in:
#    /usr/local/lib
#
# If you ever happen to want to link against installed libraries
# in a given directory, LIBDIR, you must either use libtool, and
# specify the full pathname of the library, or use the `-LLIBDIR'
# flag during linking and do at least one of the following:
#    - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
#      during execution
#    - add LIBDIR to the `LD_RUN_PATH' environment variable
#      during linking
#    - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
#    - have your system administrator add LIBDIR to `/etc/ld.so.conf'

cd /tmp
gedit Makefile &
# ---------------------------------------------------------------------
HDFHOME=/tmp/aster-full-src-10.3.0/SRC/hdf5-1.6.9
HDFINCLUDE =${HDFHOME}/include
HDFLIB= ${HDFHOME}/lib

MEDHOME=/tmp/aster-full-src-10.3.0/SRC/med-2.3.6
MEDINCLUDE=${MEDHOME}/include
MEDLIB= /usr/local/lib

CC =gcc
CFLAGS=-g -static -DPCLINUX64 -I${HDFINCLUDE} -I${MEDINCLUDE}
LFLAGS= -L${HDFLIB} -L${MEDLIB}  -lmed -lhdf5 -lm -lz

calmed1 :
        ${CC} calmed6.c ${CFLAGS} ${LFLAGS}  -o calmed6

clean :
        rm calmed6
# ---------------------------------------------------------------------


make
# gcc calmed6.c -g -static -DPCLINUX64 -I/tmp/aster-full-src-10.3.0/SRC/hdf5-1.6.9/hdf5/include -I/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/include  -L/tmp/aster-full-src-10.3.0/SRC/hdf5-1.6.9/hdf5/lib -L/usr/local/lib  -lmed -lhdf5 -lm -lz  -o calmed6
# In file included from calmed6.c:22:
# /tmp/aster-full-src-10.3.0/SRC/med-2.3.6/include/med_utils.h:144:2: error: #error "Explicit error messages must be either activated or deactivated, hence MESGERR macro must be defined."
# /tmp/aster-full-src-10.3.0/SRC/med-2.3.6/include/med_utils.h:145:2: error: #error "Verify that you include med_utils.h after med_config.h, thanks."
# make: *** [calmed1] Error 1

# Fix is to uncomment the line #include <med_config.h> in calmed6.c
gedit calmed6.c &

# Try again now
make
#gcc calmed6.c -g -static -DPCLINUX64 -I/tmp/aster-full-src-10.3.0/SRC/hdf5-1.6.9/hdf5/include -I/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/include  -L/tmp/aster-full-src-10.3.0/SRC/hdf5-1.6.9/hdf5/lib -L/usr/local/lib  -lmed -lhdf5 -lm -lz  -o calmed6
#/usr/local/lib/libmed.a(MEDmodeAcces.o): In function `MED_MODE_ACCES::Instance()':
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDmodeAcces.cxx:24: undefined reference to `__cxa_guard_acquire'
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDmodeAcces.cxx:24: undefined reference to `__cxa_guard_release'
#/usr/local/lib/libmed.a(MEDmodeAcces.o): In function `__gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<unsigned long const, med_mode_acces> > >::allocate(unsigned long, void const*)':
#/usr/include/c++/4.3/ext/new_allocator.h:92: undefined reference to `operator new(unsigned long)'
#/usr/local/lib/libmed.a(MEDmodeAcces.o): In function `std::_Rb_tree<unsigned long, std::pair<unsigned long const, med_mode_acces>, std::_Select1st<std::pair<unsigned long const, med_mode_acces> >, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, med_mode_acces> > >::_M_insert_(std::_Rb_tree_node_base const*, std::_Rb_tree_node_base const*, std::pair<unsigned long const, med_mode_acces> const&;)':
#/usr/include/c++/4.3/bits/stl_tree.h:854: undefined reference to `std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&;)'
#/usr/local/lib/libmed.a(MEDmodeAcces.o): In function `__gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<unsigned long const, med_mode_acces> > >::deallocate(std::_Rb_tree_node<std::pair<unsigned long const, med_mode_acces> >*, unsigned long)':
#/usr/include/c++/4.3/ext/new_allocator.h:98: undefined reference to `operator delete(void*)'
#/usr/local/lib/libmed.a(MEDmodeAcces.o): In function `std::_Rb_tree_iterator<std::pair<unsigned long const, med_mode_acces> >::operator--()':
#/usr/include/c++/4.3/bits/stl_tree.h:197: undefined reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base*)'
#/usr/local/lib/libmed.a(MEDmodeAcces.o): In function `std::_Rb_tree_const_iterator<std::pair<unsigned long const, med_mode_acces> >::operator--()':
#/usr/include/c++/4.3/bits/stl_tree.h:272: undefined reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base const*)'
#/usr/local/lib/libmed.a(MEDmodeAcces.o): In function `std::_Rb_tree_const_iterator<std::pair<unsigned long const, med_mode_acces> >::operator++()':
#/usr/include/c++/4.3/bits/stl_tree.h:257: undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base const*)'
#/usr/local/lib/libmed.a(MEDmodeAcces.o):(.data.DW.ref.__gxx_personality_v0[DW.ref.__gxx_personality_v0]+0x0): undefined reference to `__gxx_personality_v0'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `getVersionedApi':
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:154: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&;)'
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:154: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&;)'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `operator+<char, std::char_traits<char>, std::allocator<char> >':
#/usr/include/c++/4.3/bits/basic_string.h:2086: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&;)'
#/usr/include/c++/4.3/bits/basic_string.h:2087: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&;)'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep()':
#/usr/include/c++/4.3/bits/basic_string.h:184: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_dispose(std::allocator<char> const&;)':
#/usr/include/c++/4.3/bits/basic_string.h:236: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&;)'
#/usr/include/c++/4.3/bits/basic_string.h:236: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&;)'
#/usr/include/c++/4.3/bits/basic_string.h:236: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&;)'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `getVersionedApi':
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:154: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:154: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:154: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `MED_VERSIONED_API':
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:126: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&;)'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `~pair':
#/usr/include/c++/4.3/bits/stl_pair.h:73: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `MED_VERSIONED_API':
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:127: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&;)'
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:128: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&;)'
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:129: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&;)'
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:130: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&;)'
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:131: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&;)'
#/usr/local/lib/libmed.a(MEDversionedApi.o):/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:132: more undefined references to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&;)' follow
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `pair':
#/usr/include/c++/4.3/bits/stl_pair.h:89: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&;)'
#/usr/include/c++/4.3/bits/stl_pair.h:89: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&;)'
#/usr/include/c++/4.3/bits/stl_pair.h:89: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&;)'
#/usr/include/c++/4.3/bits/stl_pair.h:89: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&;)'
#/usr/include/c++/4.3/bits/stl_pair.h:89: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&;)'
#/usr/local/lib/libmed.a(MEDversionedApi.o):/usr/include/c++/4.3/bits/stl_pair.h:89: more undefined references to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&;)' follow
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep()':
#/usr/include/c++/4.3/bits/basic_string.h:184: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_dispose(std::allocator<char> const&;)':
#/usr/include/c++/4.3/bits/basic_string.h:236: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&;)'
#/usr/include/c++/4.3/bits/basic_string.h:236: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&;)'
#/usr/include/c++/4.3/bits/basic_string.h:236: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&;)'
#/usr/include/c++/4.3/bits/basic_string.h:236: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&;)'
#/usr/include/c++/4.3/bits/basic_string.h:236: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&;)'
#/usr/local/lib/libmed.a(MEDversionedApi.o):/usr/include/c++/4.3/bits/basic_string.h:236: more undefined references to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&;)' follow
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `MED_VERSIONED_API':
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:136: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:134: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `~pair':
#/usr/include/c++/4.3/bits/stl_pair.h:73: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `~pair':
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:135: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `MED_VERSIONED_API':
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:135: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
#/usr/local/lib/libmed.a(MEDversionedApi.o):/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:126: more undefined references to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()' follow
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `MED_VERSIONED_API::Instance()':
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:29: undefined reference to `__cxa_guard_acquire'
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:29: undefined reference to `__cxa_guard_release'
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:29: undefined reference to `__cxa_guard_abort'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `MED_VERSIONED_API':
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:126: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&;)'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `~pair':
#/usr/include/c++/4.3/bits/stl_pair.h:73: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `MED_VERSIONED_API':
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:127: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&;)'
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:128: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&;)'
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:129: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&;)'
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:130: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&;)'
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:131: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&;)'
#/usr/local/lib/libmed.a(MEDversionedApi.o):/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:132: more undefined references to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&;)' follow
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `pair':
#/usr/include/c++/4.3/bits/stl_pair.h:89: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&;)'
#/usr/include/c++/4.3/bits/stl_pair.h:89: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&;)'
#/usr/include/c++/4.3/bits/stl_pair.h:89: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&;)'
#/usr/include/c++/4.3/bits/stl_pair.h:89: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&;)'
#/usr/include/c++/4.3/bits/stl_pair.h:89: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&;)'
#/usr/local/lib/libmed.a(MEDversionedApi.o):/usr/include/c++/4.3/bits/stl_pair.h:89: more undefined references to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&;)' follow
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep()':
#/usr/include/c++/4.3/bits/basic_string.h:184: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_dispose(std::allocator<char> const&;)':
#/usr/include/c++/4.3/bits/basic_string.h:236: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&;)'
#/usr/include/c++/4.3/bits/basic_string.h:236: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&;)'
#/usr/include/c++/4.3/bits/basic_string.h:236: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&;)'
#/usr/include/c++/4.3/bits/basic_string.h:236: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&;)'
#/usr/include/c++/4.3/bits/basic_string.h:236: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&;)'
#/usr/local/lib/libmed.a(MEDversionedApi.o):/usr/include/c++/4.3/bits/basic_string.h:236: more undefined references to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&;)' follow
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `MED_VERSIONED_API':
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:136: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:135: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `~pair':
#/usr/include/c++/4.3/bits/stl_pair.h:73: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `~pair':
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:128: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `MED_VERSIONED_API':
#/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:128: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
#/usr/local/lib/libmed.a(MEDversionedApi.o):/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/misc/MEDversionedApi.cxx:126: more undefined references to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()' follow
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `__gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void (*)(int, ...)> > >::allocate(unsigned long, void const*)':
#/usr/include/c++/4.3/ext/new_allocator.h:92: undefined reference to `operator new(unsigned long)'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `pair':
#/usr/include/c++/4.3/bits/stl_pair.h:73: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&;)'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void (*)(int, ...)>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void (*)(int, ...)> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void (*)(int, ...)> > >::_M_insert_(std::_Rb_tree_node_base const*, std::_Rb_tree_node_base const*, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void (*)(int, ...)> const&;)':
#/usr/include/c++/4.3/bits/stl_tree.h:854: undefined reference to `std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&;)'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void (*)(int, ...)>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void (*)(int, ...)> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void (*)(int, ...)> > >::_M_create_node(std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void (*)(int, ...)> const&;)':
#/usr/include/c++/4.3/bits/stl_tree.h:369: undefined reference to `__cxa_begin_catch'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `__gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void (*)(int, ...)> > >::deallocate(std::_Rb_tree_node<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void (*)(int, ...)> >*, unsigned long)':
#/usr/include/c++/4.3/ext/new_allocator.h:98: undefined reference to `operator delete(void*)'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void (*)(int, ...)>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void (*)(int, ...)> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void (*)(int, ...)> > >::_M_create_node(std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void (*)(int, ...)> const&;)':
#/usr/include/c++/4.3/bits/stl_tree.h:372: undefined reference to `__cxa_rethrow'
#/usr/include/c++/4.3/bits/stl_tree.h:369: undefined reference to `__cxa_end_catch'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `std::_Rb_tree_iterator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void (*)(int, ...)> >::operator--()':
#/usr/include/c++/4.3/bits/stl_tree.h:197: undefined reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base*)'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `std::_Rb_tree_const_iterator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void (*)(int, ...)> >::operator++()':
#/usr/include/c++/4.3/bits/stl_tree.h:257: undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base const*)'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::operator()(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&;) const':
#/usr/include/c++/4.3/bits/basic_string.h:2239: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&;) const'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `std::_Rb_tree_const_iterator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void (*)(int, ...)> >::operator--()':
#/usr/include/c++/4.3/bits/stl_tree.h:272: undefined reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base const*)'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `operator< <char, std::char_traits<char>, std::allocator<char> >':
#/usr/include/c++/4.3/bits/basic_string.h:2239: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&;) const'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void (*)(int, ...)>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void (*)(int, ...)> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void (*)(int, ...)> > >::_M_erase(std::_Rb_tree_node<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void (*)(int, ...)> >*)':
#/usr/include/c++/4.3/bits/stl_tree.h:939: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `__gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void (*)(int, ...)> > >::deallocate(std::_Rb_tree_node<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void (*)(int, ...)> >*, unsigned long)':
#/usr/include/c++/4.3/ext/new_allocator.h:98: undefined reference to `operator delete(void*)'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_dispose(std::allocator<char> const&;)':
#/usr/include/c++/4.3/bits/basic_string.h:236: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&;)'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `pair':
#/usr/include/c++/4.3/bits/stl_pair.h:89: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&;)'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_dispose(std::allocator<char> const&;)':
#/usr/include/c++/4.3/bits/basic_string.h:232: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
#/usr/include/c++/4.3/bits/basic_string.h:236: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&;)'
#/usr/local/lib/libmed.a(MEDversionedApi.o): In function `~pair':
#/usr/include/c++/4.3/bits/stl_pair.h:73: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
#collect2: ld returned 1 exit status
#make: *** [calmed1] Error 1

 

Re: CalculiX to SALOME interface program

Posted by bernhardi at August 08. 2011

Hi JMB,

 

I am afraid I forgot to add a  -lstdc++  to the LDFLAGS line. PLease try

LFLAGS= -L${HDFLIB} -L${MEDLIB}  -lmed -lhdf5 -lm -lz -lstdc++

That should help.

Anyway, if you do not feel like fiddling around with loading all the libs together, please let me know an appropriate email adress. I'll then send you a statically loaded executable for 64 bit linuxes. Cannot attach it here because allowed file size is too small.

My current version of calmed translates to med file version 2.3 which is old but still can be imported into salome.

Best regards,

 

OEB

 

Previously JMB wrote:

Hello bernhardi,

Would you kindly, post some notes on how to compile the above program (calmed6.c)?

I tried using the sources of hdf5-1.6.9 and med-2.3.6 from aster-full-src-10.3.0-3.noarch.tar.gz, but to no avail.  I am running into all kinds of roadblocks in getting the appropriate pre-requisites , libraries, headers, etc. set right.  I have posted below my attempt.  Thank you.

Regards, JMB

 

Re: CalculiX to SALOME interface program

Posted by JMB at August 09. 2011

Hello bernhardi,

Thank you for your reply and correction, but I am still facing other errors, as shown below.

Previously bernhardi wrote:
I am afraid I forgot to add a  -lstdc++  to the LDFLAGS line. PLease try

LFLAGS= -L${HDFLIB} -L${MEDLIB}  -lmed -lhdf5 -lm -lz -lstdc++

After making the above change (and also removing the commented line #include <med_config.h> line in calmed6.c) I get:

make

gcc calmed6.c -g -static -DPCLINUX64 -I/tmp/aster-full-src-10.3.0/SRC/hdf5-1.6.9/include -I/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/include  -L/tmp/aster-full-src-10.3.0/SRC/hdf5-1.6.9/lib -L/usr/local/lib  -lmed -lhdf5 -lm -lz -lstdc++  -o calmed6
/usr/local/lib/libmed.a(MEDdatasetOuvrir.o): In function `_MEDdatasetOuvrir':
/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/hdfi/MEDdatasetOuvrir.c:36: undefined reference to `H5Dopen'
/usr/local/lib/libmed.a(MEDattrStringEcrire.o): In function `_MEDattrStringEcrire':
/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/hdfi/MEDattrStringEcrire.c:56: undefined reference to `H5Acreate'
/usr/local/lib/libmed.a(MEDdatagroupOuvrir.o): In function `_MEDdatagroupOuvrir':
/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/hdfi/MEDdatagroupOuvrir.c:37: undefined reference to `H5Gopen'
/usr/local/lib/libmed.a(MEDmodeErreurVerrouiller.o): In function `_MEDmodeErreurVerrouiller':
/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/hdfi/MEDmodeErreurVerrouiller.c:32: undefined reference to `H5Eset_auto'
/usr/local/lib/libmed.a(MEDattrNumEcrire.o): In function `_MEDattrNumEcrire':
/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/hdfi/MEDattrNumEcrire.c:72: undefined reference to `H5Acreate'
/usr/local/lib/libmed.a(MEDdatagroupCreer.o): In function `_MEDdatagroupCreer':
/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/hdfi/MEDdatagroupCreer.c:58: undefined reference to `H5Gcreate'
/usr/local/lib/libmed.a(MEDdatasetNumLire232.o): In function `_MEDdatasetNumLire232':
/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/hdfi/MEDdatasetNumLire232.c:119: undefined reference to `H5Dopen'
/usr/local/lib/libmed.a(MEDdatasetNumEcrire231.o): In function `_MEDdatasetNumEcrire231':
/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/hdfi/MEDdatasetNumEcrire231.c:111: undefined reference to `H5Dopen'
/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/hdfi/MEDdatasetNumEcrire231.c:119: undefined reference to `H5Dcreate'
/usr/local/lib/libmed.a(MEDdatasetNumEcrire232.o): In function `_MEDdatasetNumEcrire232':
/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/hdfi/MEDdatasetNumEcrire232.c:134: undefined reference to `H5Dopen'
/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/hdfi/MEDdatasetNumEcrire232.c:180: undefined reference to `H5Dcreate'
/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/hdfi/MEDdatasetNumEcrire232.c:141: undefined reference to `H5Dcreate'
/usr/local/lib/libmed.a(MEDdatasetNumLire231.o): In function `_MEDdatasetNumLire231':
/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/hdfi/MEDdatasetNumLire231.c:107: undefined reference to `H5Dopen'
/usr/local/lib/libmed.a(MEDdatasetStringEcrire.o): In function `_MEDdatasetStringEcrire':
/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/hdfi/MEDdatasetStringEcrire.c:46: undefined reference to `H5Dopen'
/tmp/aster-full-src-10.3.0/SRC/med-2.3.6/src/hdfi/MEDdatasetStringEcrire.c:54: undefined reference to `H5Dcreate'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5.o): In function `H5_term_library':
(.text+0x383): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5.o): In function `H5dont_atexit':
(.text+0x117c): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5.o): In function `H5garbage_collect':
(.text+0x11f5): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5.o): In function `H5set_free_list_limits':
(.text+0x1338): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5.o): In function `H5get_libversion':
(.text+0x1825): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5.o):(.text+0x195d): more undefined references to `pthread_once' follow
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5E.o): In function `H5E_get_stack':
(.text+0x91e4): undefined reference to `pthread_getspecific'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5E.o): In function `H5E_get_stack':
(.text+0x922e): undefined reference to `pthread_setspecific'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5E.o): In function `H5Eregister_class':
(.text+0x9262): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5E.o): In function `H5Eunregister_class':
(.text+0x96f8): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5E.o): In function `H5Eget_class_name':
(.text+0x99a7): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5E.o): In function `H5Eclose_msg':
(.text+0x9d77): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5E.o): In function `H5Ecreate_msg':
(.text+0x9fcb): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5E.o):(.text+0xa454): more undefined references to `pthread_once' follow
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5Eint.o): In function `H5E_walk1_cb':
(.text+0x247): undefined reference to `pthread_self'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5Eint.o): In function `H5E_walk2_cb':
(.text+0x52b): undefined reference to `pthread_self'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5F.o): In function `H5Fget_create_plist':
(.text+0x1a6): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5F.o): In function `H5Fget_access_plist':
(.text+0x43a): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5F.o): In function `H5Fget_obj_count':
(.text+0x106b): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5F.o): In function `H5Fget_obj_ids':
(.text+0x12ff): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5F.o): In function `H5Fget_vfd_handle':
(.text+0x1b4a): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5F.o):(.text+0x1e19): more undefined references to `pthread_once' follow
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5TS.o): In function `H5TS_first_thread_init':
(.text+0x3c): undefined reference to `pthread_mutex_init'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5TS.o): In function `H5TS_first_thread_init':
(.text+0x4b): undefined reference to `pthread_cond_init'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5TS.o): In function `H5TS_first_thread_init':
(.text+0x64): undefined reference to `pthread_key_create'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5TS.o): In function `H5TS_first_thread_init':
(.text+0x73): undefined reference to `pthread_key_create'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5TS.o): In function `H5TS_first_thread_init':
(.text+0x82): undefined reference to `pthread_key_create'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5TS.o): In function `H5TS_mutex_lock':
(.text+0xa2): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5TS.o): In function `H5TS_mutex_lock':
(.text+0xcf): undefined reference to `pthread_self'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5TS.o): In function `H5TS_mutex_lock':
(.text+0xda): undefined reference to `pthread_equal'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5TS.o): In function `H5TS_mutex_lock':
(.text+0x110): undefined reference to `pthread_cond_wait'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5TS.o): In function `H5TS_mutex_lock':
(.text+0x127): undefined reference to `pthread_self'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5TS.o): In function `H5TS_mutex_lock':
(.text+0x14c): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5TS.o): In function `H5TS_mutex_unlock':
(.text+0x16c): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5TS.o): In function `H5TS_mutex_unlock':
(.text+0x1a1): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5TS.o): In function `H5TS_mutex_unlock':
(.text+0x1c2): undefined reference to `pthread_cond_signal'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5TS.o): In function `H5TS_cancel_count_inc':
(.text+0x1f7): undefined reference to `pthread_getspecific'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5TS.o): In function `H5TS_cancel_count_inc':
(.text+0x279): undefined reference to `pthread_setspecific'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5TS.o): In function `H5TS_cancel_count_inc':
(.text+0x29b): undefined reference to `pthread_setcancelstate'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5TS.o): In function `H5TS_cancel_count_dec':
(.text+0x2d5): undefined reference to `pthread_getspecific'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5TS.o): In function `H5TS_cancel_count_dec':
(.text+0x2ee): undefined reference to `pthread_setcancelstate'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5Z.o): In function `H5Zregister':
(.text+0x274): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5Z.o): In function `H5Zunregister':
(.text+0x86a): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5Z.o): In function `H5Zfilter_avail':
(.text+0xc91): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5Z.o): In function `H5Zget_filter_info':
(.text+0x2f58): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5Dfill.o): In function `H5Dfill':
(.text+0x475): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libhdf5.a(H5Pdapl.o):(.text+0x278): more undefined references to `pthread_once' follow
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.a(eh_alloc.o): In function `__gnu_cxx::__scoped_lock::~__scoped_lock()':
(.text._ZN9__gnu_cxx13__scoped_lockD1Ev[__gnu_cxx::__scoped_lock::~__scoped_lock()]+0x12): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.a(eh_alloc.o): In function `__cxa_free_dependent_exception':
(.text.__cxa_free_dependent_exception+0x48): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.a(eh_alloc.o): In function `__cxa_free_dependent_exception':
(.text.__cxa_free_dependent_exception+0x6b): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.a(eh_alloc.o): In function `__cxa_free_exception':
(.text.__cxa_free_exception+0x47): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.a(eh_alloc.o): In function `__cxa_free_exception':
(.text.__cxa_free_exception+0x6a): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.a(eh_alloc.o): In function `__cxa_allocate_exception':
(.text.__cxa_allocate_exception+0xac): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.a(eh_alloc.o): In function `__cxa_allocate_exception':
(.text.__cxa_allocate_exception+0x11a): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.a(eh_alloc.o): In function `__cxa_allocate_dependent_exception':
(.text.__cxa_allocate_dependent_exception+0x5c): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.a(eh_alloc.o): In function `__cxa_allocate_dependent_exception':
(.text.__cxa_allocate_dependent_exception+0xcb): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/libgcc_eh.a(unwind-dw2.o): In function `uw_init_context_1':
(.text+0x2326): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__register_frame_info_bases':
(.text+0x42): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__register_frame_info_table_bases':
(.text+0xdb): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `_Unwind_Find_FDE':
(.text+0x1776): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `_Unwind_Find_FDE':
(.text+0x17c7): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__deregister_frame_info_bases':
(.text+0x1992): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__deregister_frame_info_bases':
(.text+0x1a1d): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__register_frame_info_bases':
(.text+0x61): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__register_frame_info_table_bases':
(.text+0xfa): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libc.a(assert.o): In function `__assert_fail':
(.text+0x1): undefined reference to `pthread_setcancelstate'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libc.a(assert.o): In function `__assert_fail':
(.text+0x42): undefined reference to `pthread_setcancelstate'
collect2: ld returned 1 exit status
make: *** [calmed1] Error 1

Previously bernhardi wrote:

Anyway, if you do not feel like fiddling around with loading all the libs together, please let me know an appropriate email adress. I'll then send you a statically loaded executable for 64 bit linuxes. Cannot attach it here because allowed file size is too small.  My current version of calmed translates to med file version 2.3 which is old but still can be imported into salome.

I would still like to attempt compiling my own executable and in the process documenting it what has worked for me, in this forum for the benefit of others.  So if you could find the time and patience to guide me through the process, I would very much appreciate it and so might a few others.  After failing a few times, I will welcome your offer of emailing the pre-compiled executable to me directly. Thank you.

Regards, JMB

Re: CalculiX to SALOME interface program

Posted by bernhardi at August 10. 2011

Hi again, 

In your makefile that you posted last time (above) there is the following HDFHOME line: 

HDFHOME=/tmp/aster-full-src-10.3.0/SRC/hdf5-1.6.9

could you please append a /hdf5 to it, so that it reads

HDFHOME=/tmp/aster-full-src-10.3.0/SRC/hdf5-1.6.9/hdf5

I was always supposed to do it this way., otherwise I miss the include etc. files for hdf5. 

Your MEDHOME seems to be OK.

Please do not hesitate to post again as many times as needed!

Best regards,

OEB

 

 

 

Re: CalculiX to SALOME interface program

Posted by JMB at August 10. 2011

Previously bernhardi wrote:

In your makefile that you posted last time (above) there is the following HDFHOME line: HDFHOME=/tmp/aster-full-src-10.3.0/SRC/hdf5-1.6.9 could you please append a /hdf5 to it, so that it reads HDFHOME=/tmp/aster-full-src-10.3.0/SRC/hdf5-1.6.9/hdf5 I was always supposed to do it this way., otherwise I miss the include etc. files for hdf5. 

Hello Berhardi,

 

That fixed it!  Thank you!  The steps which worked for me are reproduced below for the benefit of others.

 

Regards, JMB

 

==================================================================================================

#!/bin/bash

# Install CalMed6 the Calculix (*.frd) to *.med file converter
# Installed on ubuntu (Lucid 10.04 -64bit) 10Aug2011

cp ~/<Somewhere>/CodeAster-Salome/aster-full-src-10.3.0-3.noarch.tar.gz /tmp
cd /tmp
gunzip -cd aster-full-src-10.3.0-3.noarch.tar.gz | tar -xvf -
cd /tmp/aster-full-src-10.3.0/SRC/
gunzip -cd hdf5-1.6.9.tar.gz | tar -xvf -
cd /tmp/aster-full-src-10.3.0/SRC/hdf5-1.6.9
./configure
make
make install
# ... < deleted for brevity > ...
# Libraries have been installed in:
#    /tmp/aster-full-src-10.3.0/SRC/hdf5-1.6.9/hdf5/lib
#
# If you ever happen to want to link against installed libraries
# in a given directory, LIBDIR, you must either use libtool, and
# specify the full pathname of the library, or use the `-LLIBDIR'
# flag during linking and do at least one of the following:
#    - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
#      during execution
#    - add LIBDIR to the `LD_RUN_PATH' environment variable
#      during linking
#    - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
#    - have your system administrator add LIBDIR to `/etc/ld.so.conf'

cd /tmp/aster-full-src-10.3.0/SRC/
gunzip -cd med-2.3.6.tar.gz | tar -xvf -
cd /tmp/aster-full-src-10.3.0/SRC/med-2.3.6
./configure --with-hdf5=/tmp/aster-full-src-10.3.0/SRC/hdf5-1.6.9/hdf5/
make
make check
sudo make install          # sudo is needed because it installs in /usr/local/lib
# ... < deleted for brevity > ...
# Libraries have been installed in:
#    /usr/local/lib
#
# If you ever happen to want to link against installed libraries
# in a given directory, LIBDIR, you must either use libtool, and
# specify the full pathname of the library, or use the `-LLIBDIR'
# flag during linking and do at least one of the following:
#    - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
#      during execution
#    - add LIBDIR to the `LD_RUN_PATH' environment variable
#      during linking
#    - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
#    - have your system administrator add LIBDIR to `/etc/ld.so.conf'

cd ~/<Somewhere>
wget -nd http://www.salome-platform.org/forum/forum_12/126338563/597655633/calmed6.tar
cp ~/<Somewhere>/calmed6.tar /tmp
cd /tmp
tar -xvf calmed6.tar

gedit Makefile &
# ---------------------------------------------------------------------
HDFHOME=/tmp/aster-full-src-10.3.0/SRC/hdf5-1.6.9/hdf5
HDFINCLUDE =${HDFHOME}/include
HDFLIB= ${HDFHOME}/lib

MEDHOME=/tmp/aster-full-src-10.3.0/SRC/med-2.3.6
MEDINCLUDE=${MEDHOME}/include
MEDLIB= /usr/local/lib

CC =gcc
CFLAGS=-g -static -DPCLINUX64 -I${HDFINCLUDE} -I${MEDINCLUDE}
LFLAGS= -L${HDFLIB} -L${MEDLIB}  -lmed -lhdf5 -lm -lz -lstdc++

calmed1 :
        ${CC} calmed6.c ${CFLAGS} ${LFLAGS}  -o calmed6

clean :
        rm calmed6
# ---------------------------------------------------------------------

gedit calmed6.c &
# Uncomment the #include <med_config.h> line

make

Re: CalculiX to SALOME interface program

Posted by JMB at August 10. 2011

Previously bernhardi wrote:

Perhaps we could call the entire C programs from python; calling C from python should be no problem. Outcome will then be a salome module that acts like a wrapper around the interface routines.

Hello bernhardi,

Now that I have been able to compile your source code calmed6.c (with your help) can we try to call it via Python and make it a plug-in for Salome 6.3.1?  I have written a few Python plug-ins for Salome 5.1.5 before, but never in C (or C++), so it will be a learning experience for me.   I think it will be a valuable contribution to the Salome - CodeAster community.  I am willing to learn if you are willing to guide!  Thereafter, I will document the steps as I have done above.  But I do not know where to begin...  Your help is very much appreciated!  Thank you.

Regards, JMB

Re: CalculiX to SALOME interface program

Posted by bernhardi at August 11. 2011

JMB, Hi,

 

... well yes the old  rule is still valid: "hack at it long enough and it will run..." However, please post remarks if  you come across problems using calmed (or the otther beast, unical). I think there must still be very many bugs in them...

 

It is not really clear to me how to proceed with the stuff. The ultimate goal should be to have some simple gui driver that allows to start calculix from within salome (similar to salome meca?)

 

A step in that direction would be that a salome user could assign the node / element groups properties which could than be transferred to unv or any other format, so that the boundary conditions etc. could be completely done from within the graphic environment of salome (currently, I translate the groups into *elsets/ *nsets and the use a text editor to define the *boundary etc. ABAQUS commands  manually). I do not know if such a facility exists within salome-meca. As far as I have seen in the salome sources for now only the nodes, elements, and groups are translated into .unv (is that correct??)

 

Have a look into <your-path>/salome_6.3.1/SMESH_SRC_6.3.1/src/DriverUNV directory. There, you find (parts of?) the coding of the translator routines. There are drivers for UNV, STL, MED, and others. My idea was that one just could add another driver for abaqus .inp? That would perhaps be the most elegant way; then, the data is translated directly into .inp (and from .frd) instead of going via different data formats.

 

Could any of the developers please comment on this??

 

 

Best regards,

 

OEB

 

.

 

 

Re: CalculiX to SALOME interface program

Posted by JMB at September 20. 2011

Previously bernhardi wrote:

... well yes the old  rule is still valid: "hack at it long enough and it will run..." However, please post remarks if  you come across problems using calmed (or the otther beast, unical). I think there must still be very many bugs in them...

It is not really clear to me how to proceed with the stuff. The ultimate goal should be to have some simple gui driver that allows to start calculix from within salome (similar to salome meca?)

Have a look into <your-path>/salome_6.3.1/SMESH_SRC_6.3.1/src/DriverUNV directory. There, you find (parts of?) the coding of the translator routines. There are drivers for UNV, STL, MED, and others. My idea was that one just could add another driver for abaqus .inp? That would perhaps be the most elegant way; then, the data is translated directly into .inp (and from .frd) instead of going via different data formats.

Could any of the developers please comment on this??

Hello bernhardi,

I have used your calmed6 program a few times now and so far it has worked smoothly and I have not discovered any problems/errors.  I have not had the time to look into integrating it with Salome (or make a plugin) yet.  I will do so as soon as I can get some time to devote to it.  In the meantime have you considered making calmed6 compatible with version MED3?  Since Salome has jumped into MED3 without preserving backward compatibility (a very shortsighted decision, in my opinion) I think we should be prepared to provide MED3 compatibility for calmed6+ as well.  I wish and hope to assist you, but my coding skills are limited especially in C.  Hope to hear from you at your earliest convenience about your thoughts and directions on this.  Thank you again for your contributions (calmed and unical); since I use them frequently now.

Regards, JMB

Re: CalculiX to SALOME interface program

Posted by JMB at September 20. 2011

Previously bernhardi wrote:

Could any of the developers please comment on this?? 

I wonder if we will ever get a response from the Salome developers !!!

-JMB

Re: CalculiX to SALOME interface program

Posted by DAVID Gilles at September 20. 2011

Previously JMB wrote:

Previously bernhardi wrote:

Could any of the developers please comment on this?? 

I wonder if we will ever get a response from the Salome developers !!!

-JMB

Hello JMB,

There is technically no problem to add such driver. The question is: who will pay for this new driver ?

1. Currently most of the improvements in Salome are paid by either CEA or EDF. If they are interested by such driver, they may pay for it. But in the other case, the development won't be done.

2. OCC could also develop it but it will be done using its own resources. It depends on the willing of the company.

3. A last solution is the development of the driver by a developer during his free time. The problem here would be the maintenance of the code.

Please don't get obfuscate, this is how the development of Salome works and I'm pretty sure that the software would not have reach such a level in another situation.

Regards,

Gilles

Re: CalculiX to SALOME interface program

Posted by bernhardi at October 03. 2011

Hi JMB:

sorry for my late response -- I was away from home during the last weeks. However I began converting calmed to med 3.x. The current version is calmed7; I attach it here. It is not really complete and there are some issues with it; but perhaps you could give it a try? PLease comment.

Installation should be similar. In the makefile, the HDFHOME and MEDHOME parameters have to be changed to point to the new HDF and MED libraries. 

My primitive Makefile looks as follows. It generates statically linked executable files.

----------------------------

HDFHOME=/bern/hdf/hdf5-1.8.7/hdf5
HDFINCLUDE =${HDFHOME}/include
HDFLIB= ${HDFHOME}/lib

MEDHOME=/bern/med/med-3.0.3_SRC
MEDINCLUDE=${MEDHOME}/include
MEDLIB= /usr/local/lib
CC =gcc
CFLAGS=-g -static -DPCLINUX64 -I${HDFINCLUDE} -I${MEDINCLUDE}
LFLAGS= -L${HDFLIB} -L${MEDLIB}  -lmed -lhdf5 -lm -lz -lstdc++

calmed1 :
    ${CC} calmed7.c ${CFLAGS} ${LFLAGS}  -o calmed7

clean :
    rm calmed7

------------------------------

If an old .MED file is present, calmed refuses to work; delete the old MED file first.

Best regards!

OEB

Previously JMB wrote:

Previously bernhardi wrote:

... well yes the old  rule is still valid: "hack at it long enough and it will run..." However, please post remarks if  you come across problems using calmed (or the otther beast, unical). I think there must still be very many bugs in them...

It is not really clear to me how to proceed with the stuff. The ultimate goal should be to have some simple gui driver that allows to start calculix from within salome (similar to salome meca?)

Have a look into <your-path>/salome_6.3.1/SMESH_SRC_6.3.1/src/DriverUNV directory. There, you find (parts of?) the coding of the translator routines. There are drivers for UNV, STL, MED, and others. My idea was that one just could add another driver for abaqus .inp? That would perhaps be the most elegant way; then, the data is translated directly into .inp (and from .frd) instead of going via different data formats.

Could any of the developers please comment on this??

Hello bernhardi,

I have used your calmed6 program a few times now and so far it has worked smoothly and I have not discovered any problems/errors.  I have not had the time to look into integrating it with Salome (or make a plugin) yet.  I will do so as soon as I can get some time to devote to it.  In the meantime have you considered making calmed6 compatible with version MED3?  Since Salome has jumped into MED3 without preserving backward compatibility (a very shortsighted decision, in my opinion) I think we should be prepared to provide MED3 compatibility for calmed6+ as well.  I wish and hope to assist you, but my coding skills are limited especially in C.  Hope to hear from you at your earliest convenience about your thoughts and directions on this.  Thank you again for your contributions (calmed and unical); since I use them frequently now.

Regards, JMB

 

Attachments

Re: CalculiX to SALOME interface program

Posted by bernhardi at November 10. 2011

Hi to all who are interested, 

New version Calmed8, with some corrections. 

 

OEB

Attachments
Powered by Ploneboard
Document Actions