Opened 11 years ago

Closed 11 years ago

#38752 closed defect (fixed)

makefile variables in petsc +Accelerate refer to ATLAS libs

Reported by: kingcrimson@… Owned by: mamoll (Mark Moll)
Priority: Normal Milestone:
Component: ports Version: 2.1.3
Keywords: Cc: cooljeanius (Eric Gallager)
Port: petsc

Description

I installed petsc +Accelerate but the file

/opt/local/lib/petsc/conf/petscvariables

contains

PETSC_EXTERNAL_LIB_BASIC = -lX11 -L/opt/local/lib/petsc/lib -lcmumps -ldmumps -lsmumps -lzmumps -lmumps_common -lpord -lscalapack -lblacs -lparmetis -lmetis -lml -lptesmumps -lptscotch -lptscotcherr -lpthread -L/opt/local/lib -lyaml -L/usr/lib -llapack -lblas -lhdf5_fortran -lhdf5 -lhdf5hl_fortran -lhdf5_hl -lz -ldl -lmpi_f90 -lmpi_f77 -lmpi -lm -lgfortran -L/opt/local/lib/gcc47/gcc/x86_64-apple-darwin12/4.7.2 -L/opt/local/lib/gcc47 -lgfortran -lSystem -lgcc_ext.10.5 -lquadmath -lm -lm -lm -lz -lz -ldl 
HDF5_LIB = -L/opt/local/lib -lhdf5_fortran -lhdf5 -lhdf5hl_fortran -lhdf5_hl -lz

that causes the attached example to fail with this error

$ make 3_petsc_mat
/opt/local/bin/openmpicxx -o 3_petsc_mat.o -c -O2 -O2 -I/opt/local/lib/petsc/include -I/opt/local/lib/petsc/include -I/opt/local/include -I/opt/local/include/openmpi -D__INSDIR__= 3_petsc_mat.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
--> Linking the executable...  <--
/opt/local/bin/openmpicxx -Wl,-multiply_defined,suppress -Wl,-multiply_defined -Wl,suppress -Wl,-commons,use_dylibs -Wl,-search_paths_first -O2 -O2   -o 3_petsc_mat 3_petsc_mat.o  -L/opt/local/lib/petsc/lib  -lpetsc -lX11 -lcmumps -ldmumps -lsmumps -lzmumps -lmumps_common -lpord -lscalapack -lblacs -lparmetis -lmetis -lml -lptesmumps -lptscotch -lptscotcherr -lpthread -L/opt/local/lib -lyaml -L/usr/lib -llapack -lblas -lhdf5_fortran -lhdf5 -lhdf5hl_fortran -lhdf5_hl -lz -ldl -lmpi_f90 -lmpi_f77 -lmpi -lm -lgfortran -L/opt/local/lib/gcc47/gcc/x86_64-apple-darwin12/4.7.2 -L/opt/local/lib/gcc47 -lgfortran -lSystem -lgcc_ext.10.5 -lquadmath -lm -lm -lm -lz -lz -ldl 
Undefined symbols for architecture x86_64:
  "_ATL_dger", referenced from:
      _ATL_dgetf2 in liblapack.a(ATL_dgetf2.o)
  "_ATL_xerbla", referenced from:
      _atl_f77wrap_dgetrf_ in liblapack.a(ATL_f77wrap_dgetrf.o)
      _atl_f77wrap_dgetrs_ in liblapack.a(ATL_f77wrap_dgetrs.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: [3_petsc_mat] Error 1 (ignored)
/bin/rm -f 3_petsc_mat.o
-->...done.  <--

changing

-L/usr/lib -llapack -lblas

to

-Wl,-framework -Wl,Accelerate

in

/opt/local/lib/petsc/conf/petscvariables

fixes the problem for me

Attachments (2)

makefile (846 bytes) - added by kingcrimson@… 11 years ago.
example makefile
3_petsc_mat.c (1.3 KB) - added by kingcrimson@… 11 years ago.
example code

Download all attachments as: .zip

Change History (5)

Changed 11 years ago by kingcrimson@…

Attachment: makefile added

example makefile

Changed 11 years ago by kingcrimson@…

Attachment: 3_petsc_mat.c added

example code

comment:1 Changed 11 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:2 Changed 11 years ago by jmroot (Joshua Root)

Cc: mmoll@… removed
Owner: changed from macports-tickets@… to mmoll@…

comment:3 Changed 11 years ago by mamoll (Mark Moll)

Resolution: fixed
Status: newclosed

Fixed in r105139.

Note: See TracTickets for help on using tickets.