dbirch997 / cantera

Automatically exported from code.google.com/p/cantera
1 stars 0 forks source link

Preconfig detects incorrect architecture for Mac OS X 10.6.8 (Snow Leopard), 64-bit #52

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Type "./preconfig" (no quotes) at command line.
2. Type "sudo make" (no quotes) after preconfig succeeds.

What is the expected output? What do you see instead?

Expected output: Something like:

goxberry$ ./preconfig

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

           Cantera 1.8.0
         Configuration Script 

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

Cantera will be installed in /Applications/Cantera
checking build system type... x86_64-apple-darwin10.8.0
checking host system type... x86_64-apple-darwin10.8.0
checking target system type... x86_64-apple-darwin10.8.0

(followed by successful execution, a successful build, and a successful install)

What I get instead:

goxberry$ ./preconfig

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

           Cantera 1.8.0
         Configuration Script 

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

Cantera will be installed in /Applications/Cantera
checking build system type... i386-apple-darwin10.8.0
checking host system type... i386-apple-darwin10.8.0
checking target system type... i386-apple-darwin10.8.0

(followed by a bunch of output)

checking MATLAB (/Applications/MATLAB_R2010b.app/bin/matlab)... 
/Applications/MATLAB_R2010b.app/bin/matlab

----------------------------  MATLAB -------------------------------
MEX file extension:  mexmaci64
MATLAB command:  /Applications/MATLAB_R2010b.app/bin/matlab
--------------------------------------------------------------------

(followed by more output)

config.status: config.h is unchanged

Now type 'make' to build Cantera

goxberry$ sudo make

(followed by even more output)

-> gcc-4.0 -O -Wl,-twolevel_namespace -undefined error -arch x86_64 
-Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 
-bundle 
-Wl,-exported_symbols_list,/Applications/MATLAB_R2010b.app/extern/lib/maci64/mex
Function.map -o  "ctmethods.mexmaci64"  ctmethods.o ctfunctions.o xmlmethods.o 
phasemethods.o thermomethods.o kineticsmethods.o mixturemethods.o 
transportmethods.o reactormethods.o reactornetmethods.o wallmethods.o 
flowdevicemethods.o funcmethods.o onedimmethods.o surfmethods.o  
-L/Users/goxberry/ScientificSoftware/cantera-1.8.0-beta/build/lib/i386-apple-dar
win10.8.0 -L/usr/local/lib -lclib -luser -loneD -lzeroD -lequil -lkinetics 
-ltransport -lthermo -lctnumerics -lctmath -ltpx -lctspectra -lconverters 
-lctbase -lsundials_cvodes -lsundials_nvecserial -lctf2c -lctf2c -lm 
-L/Applications/MATLAB_R2010b.app/bin/maci64 -lmx -lmex -lmat -lstdc++

ld: warning: in 
/Users/goxberry/ScientificSoftware/cantera-1.8.0-beta/build/lib/i386-apple-darwi
n10.8.0/libctspectra.a, file was built for unsupported file format which is not 
the architecture being linked (x86_64)
Undefined symbols:
  "_dgbtrf_", referenced from:
      Cantera::BandMatrix::factor()     in libctnumerics.a(BandMatrix.o)
  "_dgbtrs_", referenced from:
      Cantera::BandMatrix::solve(int, double*)in libctnumerics.a(BandMatrix.o)
  "_dgemv_", referenced from:
      Cantera::increment(Cantera::DenseMatrix const&, double const*, double*)in libctnumerics.a(DenseMatrix.o)
      Cantera::DenseMatrix::mult(double const*, double*) constin libctnumerics.a(DenseMatrix.o)
      Cantera::multiply(Cantera::DenseMatrix const&, double const*, double*)in libctnumerics.a(DenseMatrix.o)
      Cantera::L_Matrix::mult(double const*, double*) constin libtransport.a(MultiTransport.o)
      Cantera::L_Matrix::mult(double const*, double*) constin libtransport.a(MultiTransport.o)
      Cantera::L_Matrix::mult(double const*, double*) constin libtransport.a(MultiTransport.o)
  "Cantera::CVodesIntegrator::CVodesIntegrator()", referenced from:
      Cantera::newIntegrator(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libctnumerics.a(ODE_integrators.o)
  "_dgetrf_", referenced from:
      Cantera::solve(Cantera::DenseMatrix&, Cantera::DenseMatrix&)in libctnumerics.a(DenseMatrix.o)
      Cantera::solve(Cantera::DenseMatrix&, double*)in libctnumerics.a(DenseMatrix.o)
      Cantera::invert(Cantera::DenseMatrix&, int)in libctnumerics.a(DenseMatrix.o)
      Cantera::MultiTransport::getMassFluxes(double const*, double const*, double, double*)in libtransport.a(MultiTransport.o)
      Cantera::MultiTransport::getSpeciesFluxes(int, double const*, int, double const*, int, double*)in libtransport.a(MultiTransport.o)
      Cantera::solveSP::solveSurfProb(int, double, double, double, double, double)in libkinetics.a(solveSP.o)
  "_dgetri_", referenced from:
      Cantera::invert(Cantera::DenseMatrix&, int)in libctnumerics.a(DenseMatrix.o)
  "_dgetrs_", referenced from:
      Cantera::solve(Cantera::DenseMatrix&, Cantera::DenseMatrix&)in libctnumerics.a(DenseMatrix.o)
      Cantera::solve(Cantera::DenseMatrix&, double*)in libctnumerics.a(DenseMatrix.o)
      Cantera::MultiTransport::getMassFluxes(double const*, double const*, double, double*)in libtransport.a(MultiTransport.o)
      Cantera::MultiTransport::getSpeciesFluxes(int, double const*, int, double const*, int, double*)in libtransport.a(MultiTransport.o)
      Cantera::solveSP::solveSurfProb(int, double, double, double, double, double)in libkinetics.a(solveSP.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status

    mex: link of ' "ctmethods.mexmaci64"' failed.

??? Error using ==> mex at 208
Unable to complete successfully.

Error in ==> buildux at 3
mex -cxx -v private/ctmethods.cpp private/ctfunctions.cpp ...

Error in ==> setup at 2
buildux

>> quit
rm -f setup.m 
cd tools; make
cd src; make
rm -f 
/Users/goxberry/ScientificSoftware/cantera-1.8.0-beta/build/bin/i386-apple-darwi
n10.8.0/cti2ctml
g++-4.0 -o 
/Users/goxberry/ScientificSoftware/cantera-1.8.0-beta/build/bin/i386-apple-darwi
n10.8.0/cti2ctml cti2ctml.o 
-L/Users/goxberry/ScientificSoftware/cantera-1.8.0-beta/build/lib/i386-apple-dar
win10.8.0   -L/usr/local/lib -O3 -Wall -arch x86_64   -luser -loneD -lzeroD 
-lequil -lkinetics -ltransport -lthermo -lctnumerics -lctmath -ltpx -lctspectra 
-lconverters -lctbase -lsundials_cvodes -lsundials_nvecserial  -lctf2c   \
               -lctf2c -lm -framework Accelerate 
ld: warning: in cti2ctml.o, file was built for i386 which is not the 
architecture being linked (x86_64)
ld: warning: in 
/Users/goxberry/ScientificSoftware/cantera-1.8.0-beta/build/lib/i386-apple-darwi
n10.8.0/libctspectra.a, file was built for unsupported file format which is not 
the architecture being linked (x86_64)
Undefined symbols:
  "_MAIN__", referenced from:
      _main in libctf2c.a(main.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** 
[/Users/goxberry/ScientificSoftware/cantera-1.8.0-beta/build/bin/i386-apple-darw
in10.8.0/cti2ctml] Error 1
make[1]: *** [apps] Error 2
make: *** [utils] Error 2

What version of the product are you using? On what operating system?

I'm using Cantera 1.8.0 (beta) on Mac OS X 10.6.8 (Snow Leopard) 64-bit, with 
Matlab R2010b (64-bit).

Please provide any additional information below.

To summarize, preconfig detects a different architecture than than OS I'm 
running, which causes building the Matlab interface to fail. I believe this 
issue could be related to Issue 45 (ctmethods.mexmaci64 linking error when 
building on a 64-bit Mac). The build process works beautifully using Matlab 
R2010b (64-bit) on Ubuntu 10.04 (64-bit).

Original issue reported on code.google.com by goxbe...@gmail.com on 8 Jul 2011 at 4:36

GoogleCodeExporter commented 9 years ago
The cause of this problem is different architectures (32 and 64 bit) being 
linked together, which doesn't work.

the _dg.... functions in the libraries being linked are Lapack and Blas stuff. 
These are your (64-bit) system Lapack and Blas. On Mac, those are built-in 
(that's what the -framework Accelerate does). They are 64 bit b/c Snow Leopard 
is 64 bit. Snow Leopard is capable of compiling and running 32-bit programs, 
but to be safe, or anytime you're linking to system libraries, you will want to 
build 64-bit architecture binaries.

You can force your compiler to do this by using CFLAGS and CXXFLAGS, which are 
compiler flags that Cantera will use. Set them like this (in your preconfig 
file):

CFLAGS="-arch x86_64"
CXXFLAGS="-arch x86_64"

This will force Cantera to build using the 64-bit architecture, to match your 
Lapack/Blas.

Original comment by r...@charlesmartinreid.com on 15 Dec 2011 at 3:10

GoogleCodeExporter commented 9 years ago
This should be implicitly resolved by the transition to the SCons-based build 
system.

Original comment by yarmond on 9 Apr 2012 at 11:53

GoogleCodeExporter commented 9 years ago
i still get this error using cantera 2.0 with intel mkl

Original comment by ricardo...@gmail.com on 5 Jun 2012 at 2:10

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Did you know how to solve this issue on mac os x lion using canter 2. It 
happens when i compile the flame speed demo using scons

Original comment by ricardo...@gmail.com on 21 Jun 2012 at 5:47