From: Rainer M. <ra...@tb...> - 2007-06-11 09:59:16
|
Hi John, The log file contains two errors: ASTIndexNameNode.cpp:79: error: function `int ASTNode_isIndexName(ASTNode_t*)' definition is marked dllimport. ASTIndexNameNode.cpp:87: error: function `unsigned int ASTNode_isSetIndex(ASTNode_t*)' definition is marked dllimport Unfortunately we have no knowledge here about the dll import/export in Windows. However, the file src/sbmlsolver/exportdefs.h is important for that. The "marked as dllimport" probably comes from the definition of SBML_ODESOLVER_API, which was introduced for such import/export issues by Andrew. It is supposed to indicate functions that are exported, i.e. that should be available for calling applications which use SOSlib as a libary. Both functions, ASTNode_isIndexName and ASTNode_isSetIndex, have this prefix. In exportsdefs.h: #ifdef WIN32 #ifdef SBML_ODESOLVER_EXPORTS #define SBML_ODESOLVER_API __declspec(dllexport) #else #define SBML_ODESOLVER_API __declspec(dllimport) #endif #else #define SBML_ODESOLVER_API #endif So this prefix can have two values, one for export, one for import. Now, I guess we only need to find out what that means :) and when/how to set SBML_ODESOLVER_EXPORTS. Andrew's comment in exportdefs.h says: /* The following ifdef block is the standard way of creating macros which make exporting from a DLL simpler. All files within this DLL are compiled with the SBML_ODESOLVER_EXPORTS symbol defined on the command line. this symbol should not be defined on any project that uses this DLL. This way any other project whose source files include this file see SBML_ODESOLVER_API functions as being imported from a DLL, whereas this DLL sees symbols defined with this macro as being exported. */ The symbol is also mentioned in the Win32 VisualC++ folder, in the (main?) project file Win32/SBML_odeSolver/SBML_odeSolver/SBML_odeSolver.vcproj: PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SBML_ODESOLVER_EXPORTS" Maybe it suffices to define it on commandline (to 1 e.g.)? So the compiler knows that the functions are being exported?? However, I wonder if it is an (alphabetical) accident of the make process, that this error occurs in our only C++ functions in ASTIndexNameNode.cpp, or whether the problem is really C++-specific and import/export related. The code in this file imports and modifies the libSBML Abstract Syntax Tree class (AST, contains math equations). Rainer John Legato wrote: > Hi Rainer, > > We are attempting a build under mingw using the precompiled distribution > of libsbml 2.3.4 (we tried to build it from source under mingw and it > failed with dll export errors). We are getting dllexport errors with > soslib as well. I've attached the log of the build. Do you have any > insights? > > Thanks > > John > > > On Wed, 6 Jun 2007, Rainer Machne wrote: > >> Hi John, >> >> The windows/Visual C++ files (Win32 directory in source code >> distribution) where made by Andrew Finney and unfortunately we have so >> far not found the time to get into it and keep the windows branch >> up-to-date or even understand how it works on Windows. Unfortunately >> Andrew is no longer active. Christoph and James are currently at the >> SBML hackathon and Andrew will be there. So maybe they can help you >> from there! >> >> It is definitely something we need to understand and repair for the >> next release: installing from source under Cygwin or MinGW (have you >> tried Akira's instructions for MinGW at >> http://www.tbi.univie.ac.at/~raim/odeSolver/doc/installWin.html#src ?) >> and as a Visual C++ project. >> >> Rainer >> >> John Legato wrote: >> >>> Hi Rainer, >>> >>> We are still attempting to get a windows based DLL of soslib to use >>> with Java bindings. I was wondering if you could suggest what might >>> be the best route. We've tried Cygwin but got hung up on a link issue >>> with libsbml which the Xerces rearranging the link flags to put >>> -lsbml before -lxerces was suggested by the Xerces folks. This worked >>> for the examples but using the same options building SOSlib was >>> unsuccessful. >>> >>> I am in the process of attempting the Visual C++ route to build a >>> native library. I can successfully build WinCVODE but other modules >>> fail due to missing header files. For example kinsol.h is missing, I >>> know it's in the sundials distribution but it doesn't seem to be >>> included in the sundials headers included with SOSlib. Do I need to >>> build sundials from source on Windows to get a successful build? >>> >>> I've tried to use SWIG with the prebuilt distribution for Windows but >>> I can't seem to find the header files for SOSlib. release.zip appears >>> to only include the DLLs without headers. I am also confused >>> regarding the DLL names under windows. Under Linux we have libODES.a, >>> under windows I see SBML_odeSolver.dll and WinCVODE.dll. Has SOSlib >>> been split up differently under Windows? Is there a roadmap somewhere >>> to the Windows build? I see a readme on the web but I am missing a >>> few steps. >>> >>> Thanks >>> >>> John >>> >>> >>> --- >>> Contractor >> > > --- > Contractor > > > ------------------------------------------------------------------------ > > tar xzf SBML_odeSolver-1.6.0.tar.gz > cd SBML_odeSolver-1.6.0; \ > export LDFLAGS="-L/home/jlegato/SOSlibSWIG/xerces/lib -L/home/jlegato/SOSlibSWIG/libsbml2_3_4/lib -L/home/jlegato/SOSlibSWIG/sundials/lib" && ./configure LDFLAGS="-L/home/jlegato/SOSlibSWIG/xerces/lib -L/home/jlegato/SOSlibSWIG/libsbml2_3_4/lib -L/home/jlegato/SOSlibSWIG/sundials/lib" --prefix=/home/jlegato/SOSlibSWIG/SBML_odeSolver-1.6.0_installed -with-sundials=/home/jlegato/SOSlibSWIG/sundials-2.1.1 --with-libsbml=/home/jlegato/SOSlibSWIG/libsbml2_3_4 && \ > patch src/Makefile ../SBML_so.patch && make LDFLAGS="-L/home/jlegato/SOSlibSWIG/xerces/lib -L/home/jlegato/SOSlibSWIG/libsbml2_3_4/lib -L/home/jlegato/SOSlibSWIG/sundials/lib ";make install > checking for a BSD-compatible install... /bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking build system type... i686-pc-mingw32 > checking host system type... i686-pc-mingw32 > checking for g++... g++ > checking for C++ compiler default output file name... a.exe > checking whether the C++ compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... .exe > checking for suffix of object files... o > checking whether we are using the GNU C++ compiler... yes > checking whether g++ accepts -g... yes > checking for style of include used by make... GNU > checking dependency style of g++... gcc3 > checking for gcc... gcc > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking dependency style of gcc... gcc3 > checking how to run the C preprocessor... gcc -E > checking for ranlib... ranlib > checking for a BSD-compatible install... /bin/install -c > checking whether make sets $(MAKE)... (cached) yes > checking for autoconf... /bin/autoconf > checking for aclocal... /bin/aclocal > checking for make... /bin/make > checking for ar... /mingw/bin/ar > checking for swig... /usr/local/bin/swig > checking for perl... /bin/perl > checking for SBML Library Version... expr: syntax error > expr: syntax error > expr: syntax error > ./configure: test: -eq: unary operator expected > configure: found SBML Library Version > ./configure: test: =: unary operator expected > checking correct functioning of SBML... yes > ./configure: test: -eq: unary operator expected > checking correct functioning of SUNDIALS CVODE... yes > checking for GRACE Library headers... checking for GRACE Library... checking correct functioning of GRACE... no: > CFLAGS=-g -O2 > LDFLAGS=-L/home/jlegato/SOSlibSWIG/xerces/lib -L/home/jlegato/SOSlibSWIG/libsbml2_3_4/lib -L/home/jlegato/SOSlibSWIG/sundials/lib > LIBS= > Can not link to GRACE Library! > odeSolver will be installed without XMGrace functionality > checking for dot... no > configure: found Graphviz Library Version > ./configure: test: -ge: unary operator expected > installed version of graphviz is too old! > disabling graphviz functionality!!!!!!!!! > ./configure: test: -ge: unary operator expected > ./configure: =no: command not found > ./configure: test: =: unary operator expected > : > CFLAGS=-g -O2 > LDFLAGS=-L/home/jlegato/SOSlibSWIG/xerces/lib -L/home/jlegato/SOSlibSWIG/libsbml2_3_4/lib -L/home/jlegato/SOSlibSWIG/sundials/lib > LIBS= > Can not link to GRAPHVIZ Library > odeSolver will be installed without Graphviz functionality > ./configure: test: =: unary operator expected > checking for isnan in -lm... yes > checking for egrep... grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking errno.h usability... yes > checking errno.h presence... yes > checking for errno.h... yes > checking math.h usability... yes > checking math.h presence... yes > checking for math.h... yes > checking whether byte ordering is bigendian... no > checking for an ANSI C-conforming const... yes > checking for size_t... yes > configure: creating ./config.status > config.status: creating ./Makefile > config.status: creating examples/Makefile > config.status: creating odeSolver/Makefile > config.status: creating src/Makefile > config.status: creating src/libODES.pc > config.status: creating bindings/Makefile > config.status: creating bindings/swig/Makefile > config.status: creating bindings/perl/Makefile > config.status: creating bindings/perl/Makefile.PL > config.status: creating src/sbmlsolver/config.h > config.status: executing depfiles commands > ./configure: test: !=: unary operator expected > > Build Settings for SBML_odeSolver v1.6.0: > ---------------------------------- > host type = > shared lib extension = > install dir = /home/jlegato/SOSlibSWIG/SBML_odeSolver-1.6.0_installed > CC = gcc > CFLAGS = > LDFLAGS = > LIBS = -lm > SBML Library = yes > CFLAGS = -I/home/jlegato/SOSlibSWIG/libsbml2_3_4/include -I/home/jlegato/SOSlibSWIG/libsbml2_3_4/include/sbml > LDFLAGS = -L/home/jlegato/SOSlibSWIG/libsbml2_3_4/lib > LIBS = -lsbml > SUNDIALS Library = yes > CFLAGS = -I/home/jlegato/SOSlibSWIG/sundials-2.1.1/include > LDFLAGS = -L/home/jlegato/SOSlibSWIG/sundials-2.1.1/lib > LIBS = -lsundials_kinsol -lsundials_cvodes -lsundials_cvode -lsundials_nvecserial -lsundials_shared > GRACE = no > XMGRACE functionality will NOT be installed! > GRAPHVIZ = no > GRAPHVIZ functionality will NOT be installed! > > NOTE: > Unfortunately the current version of the SBML ODE Solver > only works with the libSBML version >= 2.3.2. > > patching file `src/Makefile' > make[1]: Entering directory `/home/jlegato/SOSlibSWIG/SBML_odeSolver-1.6.0' > Making all in src > make[2]: Entering directory `/home/jlegato/SOSlibSWIG/SBML_odeSolver-1.6.0/src' > if g++ -DHAVE_CONFIG_H -I. -I. -I../src/sbmlsolver -I/home/jlegato/SOSlibSWIG/sundials-2.1.1/include -I/home/jlegato/SOSlibSWIG/libsbml2_3_4/include -I/home/jlegato/SOSlibSWIG/libsbml2_3_4/include/sbml -I. -g -O2 -MT ASTIndexNameNode.o -MD -MP -MF ".deps/ASTIndexNameNode.Tpo" -c -o ASTIndexNameNode.o ASTIndexNameNode.cpp; \ > then mv -f ".deps/ASTIndexNameNode.Tpo" ".deps/ASTIndexNameNode.Po"; else rm -f ".deps/ASTIndexNameNode.Tpo"; exit 1; fi > ASTIndexNameNode.cpp:79: error: function `int ASTNode_isIndexName(ASTNode_t*)' definition is marked dllimport. > > ASTIndexNameNode.cpp:87: error: function `unsigned int ASTNode_isSetIndex(ASTNode_t*)' definition is marked dllimport. > > make[2]: *** [ASTIndexNameNode.o] Error 1 > make[2]: Leaving directory `/home/jlegato/SOSlibSWIG/SBML_odeSolver-1.6.0/src' > make[1]: *** [all-recursive] Error 1 > make[1]: Leaving directory `/home/jlegato/SOSlibSWIG/SBML_odeSolver-1.6.0' > make[1]: Entering directory `/home/jlegato/SOSlibSWIG/SBML_odeSolver-1.6.0' > Making install in src > make[2]: Entering directory `/home/jlegato/SOSlibSWIG/SBML_odeSolver-1.6.0/src' > if g++ -DHAVE_CONFIG_H -I. -I. -I../src/sbmlsolver -I/home/jlegato/SOSlibSWIG/sundials-2.1.1/include -I/home/jlegato/SOSlibSWIG/libsbml2_3_4/include -I/home/jlegato/SOSlibSWIG/libsbml2_3_4/include/sbml -I. -g -O2 -MT ASTIndexNameNode.o -MD -MP -MF ".deps/ASTIndexNameNode.Tpo" -c -o ASTIndexNameNode.o ASTIndexNameNode.cpp; \ > then mv -f ".deps/ASTIndexNameNode.Tpo" ".deps/ASTIndexNameNode.Po"; else rm -f ".deps/ASTIndexNameNode.Tpo"; exit 1; fi > ASTIndexNameNode.cpp:79: error: function `int ASTNode_isIndexName(ASTNode_t*)' definition is marked dllimport. > > ASTIndexNameNode.cpp:87: error: function `unsigned int ASTNode_isSetIndex(ASTNode_t*)' definition is marked dllimport. > > make[2]: *** [ASTIndexNameNode.o] Error 1 > make[2]: Leaving directory `/home/jlegato/SOSlibSWIG/SBML_odeSolver-1.6.0/src' > make[1]: *** [install-recursive] Error 1 > make[1]: Leaving directory `/home/jlegato/SOSlibSWIG/SBML_odeSolver-1.6.0' > make: *** [soslib] Error 2 |