Home My Page Projects PaStiX
Summary Activity Forums Lists Docs News Files

Forum: help

Monitor Forum | Start New Thread Start New Thread
RE: Compilation on OSX: duplicate symbols [ Reply ]
By: Xavier Lacoste on 2013-09-17 14:47
[forum:147783]
I saw that you change that, but in that case it breaks ../install/libXXX.dylib because they contain $LIBDIR/libXXX.dylib as path, no ?
In the second patch I disabled the cp for dynamic libraries so that it builds both dynamic library in BUILD_LIBDIR and LIBDIR.

In my case when I set install directory to ../my-install I get :

> otool -L ../my-install/lib/libpastix.dylib
../my-install/lib/libpastix.dylib:
/Users/lacoste/INRIA/ricar/my-install/lib/libpastix.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/Cellar/gfortran/4.8.1/gfortran/lib/libgfortran.3.dylib (compatibility version 4.0.0, current version 4.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib (compatibility version 1.0.0, current version 1.0.0)
/Users/lacoste/INRIA/ricar/trunk.git/../install/libpastix.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/lib/libmpi.1.dylib (compatibility version 2.0.0, current version 2.8.0)

Is it right for you ?

XL


RE: Compilation on OSX: duplicate symbols [ Reply ]
By: Dominique Orban on 2013-09-17 14:11
[forum:147781]
Note that in my patch, I replaced the substitutions

$(subst __SO_NAME__,$@, ${SHARED_FLAGS})

with

$(subst __SO_NAME__,$(LIBDIR)/$(@F), ${SHARED_FLAGS})

for the libs to have the correct `install_name`. It won't work without that (unless you know of a more elegant way to achieve the same result).

RE: Compilation on OSX: duplicate symbols [ Reply ]
By: Xavier Lacoste on 2013-09-17 05:43
[forum:147778]

patch3 (12) downloads
Hello,

Does this patch also is correct (yours didn't gave correct .so files in ../install I think, only in LIBDIR)

XL.

RE: Compilation on OSX: duplicate symbols [ Reply ]
By: Dominique Orban on 2013-09-16 20:25
[forum:147776]
Hi Xavier,

Many thanks. The patch is almost correct. I'm having success with this one: http://git.io/NQZkTg

Everything works: Scotch 5, Scotch 6, Metis 4, Open BLAS, ...

I'm looking forward to the CMake version (although it will require that I re-write the Homebrew formula...)

I'm having a few failures in the example programs but I'll report that separately. Thanks for all your help!!!

RE: Compilation on OSX: duplicate symbols [ Reply ]
By: Xavier Lacoste on 2013-09-16 07:45
[forum:147775]

patch (12) downloads
Hello,

I attached a patch that should solve the problems :
- I do not copy anymore the dylibs but I create new ones in installation library directory.
- I changed PREFIX from :
PREFIX = ${PWD}/../install
to
PREFIX ?= ${PWD}/../install
so that you can redefine it in config.in file.

This ../install directory is something historical, anyway it will disappear when our CMake branch will be merged with the trunk.

Does this patch is correct ?
If yes, I'll commit it to trunk and 5.2.1 and make a new tarball.

XL.

RE: Compilation on OSX: duplicate symbols [ Reply ]
By: Dominique Orban on 2013-09-13 17:08
[forum:147774]
Actually, I'm sorry, but there is another problem, with the Pastix libraries this time. On the Mac, when you create a library with, e.g.,

mpicc -shared -o /some/path/bla.dylib ...

the library `bla.dylib` will have the path `/some/path` hardcoded in it as its install location. This is a problem for the following reason. I checked out tag 5.2.1 in /tmp, so my source dir is /tmp/5.2.1. During the build, the Pastix makefiles appear to create a new folder /tmp/5.2.1/../install (one level up!) When the libs are created they contain the *absolute* path /tmp/5.2.1/../install, even after they've been installed to their final location (elsewhere):

$ otool -L libmatrix_driver_32bit_mpi_smp_int32_double_real_metis_i686_mac.dylib
libmatrix_driver_32bit_mpi_smp_int32_double_real_metis_i686_mac.dylib:
/tmp/5.2.1/../install/libmatrix_driver_32bit_mpi_smp_int32_double_real_metis_i686_mac.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/Cellar/gfortran/4.8.1/gfortran/lib/libgfortran.3.dylib (compatibility version 4.0.0, current version 4.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib (compatibility version 1.0.0, current version 1.0.0)
/tmp/5.2.1/../install/libpastix_32bit_mpi_smp_int32_double_real_metis_i686_mac.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/lib/libmpi.1.dylib (compatibility version 2.0.0, current version 2.8.0)

On the Mac, the `ld` man page (http://goo.gl/xC9BzK) says to use the option `-install_name` to specify the install path for dylib to locate the library. Otherwise, when /tmp/install gets removed, everything is left broken. The simple test drivers don't run anymore. So `-install_name` allows you to override the `-o` path, which is usually absolute.

An additional problem is that if I were to compile Pastix in my home dir (say), I wouldn't have write permissions to `../install`.

I hope that makes some sense.

Dominique

RE: Compilation on OSX: duplicate symbols [ Reply ]
By: Xavier Lacoste on 2013-09-13 15:21
[forum:147773]
I tried to fix the double definitions errors in trunk and I uploaded a new tarball.

Anyway the trunk is for developpement, so it's not always stable. tag 5.2.1 is better.

Thanks for all.

XL.

RE: Compilation on OSX: duplicate symbols [ Reply ]
By: Dominique Orban on 2013-09-13 13:54
[forum:147772]
Thank you Xavier!

Here's the make log for trunk: https://gist.github.com/6550269 (scroll all the way down).

Here's my `complex.h`: https://gist.github.com/6550288
It seems that it defines COMPLEX_H.

All seems well with Scotch now in Tag 5.2.1. I'm still having a little trouble with Metis but it's related to Homebrew, not to Pastix.

Will there be an updated release of 5.2.1? It's easier to get brew formulae for releases accepted than for svn checkouts.

Thanks for all your help!

RE: Compilation on OSX: duplicate symbols [ Reply ]
By: Xavier Lacoste on 2013-09-13 07:08
[forum:147770]
Hello,

I fixed the missing stdint.h in 5.2.1 and the warning.

I'll try to fix other warnings.

Yes I would be interested if you could gist the output of make on the trunk too.

Thanks,

XL.

EDIT: Could you also tell me what is in your complex.h file, the warnings about missing declaration are due to the bad test on complex.h inclusion :

#if (defined _COMPLEX_H || defined _H_COMPLEX || defined __COMPLEX__ || _GLIBCXX_HAVE_COMPLEX_H == 1 || defined __STD_COMPLEX || defined _STLP_template_complex)
# define PASTIX_HAS_COMPLEX
#endif

Maybe I have to look for an other macro...,

In my /usr/include/complex.h I have :

/*******************************************************************************
* *
* File: complex.h *
* *
* Contains: prototypes and macros germane to C99 complex math. *
* *
*******************************************************************************/
#ifndef __COMPLEX__
#define __COMPLEX__

Thus I check for __COMPLEX__ definition.

XL.

RE: Compilation on OSX: duplicate symbols [ Reply ]
By: Dominique Orban on 2013-09-12 19:03
[forum:147769]
Thank you. I retrieved tag 5.2.1 and `make examples` still complains that `stdint.h` is missing from `example/src/murge-product.c`. That seems to have been fixed in trunk but trunk gives me a bunch of other multiply defined symbol errors (that I can report if you would like).

I also wanted to mention that `make` and `make examples` return a number of warnings that you may want to check:

* `make` says:

--
sopalin/src/pastix.c:2105:15: warning: variable 'nsave' is used uninitialized whenever 'if' condition is false
[-Wsometimes-uninitialized]
if (PASTIX_MASK_ISTRUE(iparm[IPARM_IO_STRATEGY], API_IO_SAVE_CSC))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./common/src/common_pastix.h:766:39: note: expanded from macro 'PASTIX_MASK_ISTRUE'
#define PASTIX_MASK_ISTRUE(var, mask) (var == (var | mask))
^~~~~~~~~~~~~~~~~~~~~
sopalin/src/pastix.c:2117:38: note: uninitialized use occurs here
nsave,
^~~~~
sopalin/src/pastix.c:2105:11: note: remove the 'if' if its condition is always true
if (PASTIX_MASK_ISTRUE(iparm[IPARM_IO_STRATEGY], API_IO_SAVE_CSC))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sopalin/src/pastix.c:2102:20: note: initialize the variable 'nsave' to silence this warning
INT nsave;
^
= 0
--

The complete output of `make examples` is at http://git.io/1JcLGw (search for warning).

Please let me know if you update tag 5.2.1. I'd rather use that than trunk since it's a milestone.

Many thanks!

RE: Compilation on OSX: duplicate symbols [ Reply ]
By: Xavier Lacoste on 2013-09-12 07:15
[forum:147765]
Ok, I'll update all those files, thanks for all your work !

XL.

RE: Compilation on OSX: duplicate symbols [ Reply ]
By: Dominique Orban on 2013-09-11 18:34
[forum:147764]
Thank you. In tag 5.2.1, `stdint.h` was also missing from a bunch of other files:

in matrix_drivers/src:

get_options.c
read_matrix.c
rsaread.c
hbread.c
mmread.c
mmdread.c
petscread.c
cccread.c
olafread.c
chbread.c
cscread.c
peerread.c
threefilesread.c
fdupread.c
laplacian.c

in example/src:

murge-product.c

After all that, the basic example `./example/bin/simple -lap 100` works.

Thanks!

RE: Compilation on OSX: duplicate symbols [ Reply ]
By: Xavier Lacoste on 2013-09-11 14:06
[forum:147763]
Hello,

You're right the stdint.h is missing from there, I'll fix that and commit.
I don't know why I didn't get this error on my mac...

XL

RE: Compilation on OSX: duplicate symbols [ Reply ]
By: Dominique Orban on 2013-09-11 13:02
[forum:147762]
Hi,

It's in `stdint.h` for me as well but `common_drivers.c` doesn't appear to include it:

---
mpicc -O3 -Wall -fPIC -DINTSIZE32 -DCUDA_SM_VERSION=20 -I/usr/local/Cellar/scotch5/5.1.12b/include -DDISTRIBUTED -DWITH_SCOTCH -DVERSION='"4441"' -DX_ARCHi686_mac -DDOF_CONSTANT -DVERSION='"4441"' -DX_ARCHi686_mac -DDOF_CONSTANT -I/tmp/5.2.1/../install -DPREC_DOUBLE -c matrix_drivers/src/common_drivers.c -o matrix_drivers/obj/i686_mac/common_drivers.o
In file included from matrix_drivers/src/common_drivers.c:17:
/tmp/5.2.1/../install/pastix.h:4:9: error: unknown type name 'uint32_t'
typedef uint32_t pastix_uint_t;
^
1 error generated.
make: *** [matrix_drivers/obj/i686_mac/common_drivers.o] Error 1
---

I'm not sure if the fact that `mpicc` is being used plays a role here.

Thanks for your patience!

RE: Compilation on OSX: duplicate symbols [ Reply ]
By: Xavier Lacoste on 2013-09-11 06:46
[forum:147759]
Hello,

So now it's uint32_t whereas it was u_int32_t before.

On my mac it is defined in stdint.h:50 :

grep -n uint32_t /usr/include/stdint.h
50:typedef unsigned int uint32_t;
65:typedef uint32_t uint_least32_t;
76:typedef uint32_t uint_fast32_t;

The stdint.h file is included before pastix.h in examples.

Which file is being compiled when the error occured ?

Thanks for your hard work.

XL.


RE: Compilation on OSX: duplicate symbols [ Reply ]
By: Dominique Orban on 2013-09-10 17:09
[forum:147758]
Well, sorry if I'm being thick but I checked out the 5.2.1 tag and also trunk and both still give me

--
private/tmp/pastix-NCky/../install/pastix.h:4:9: error: unknown type name 'uint32_t'
typedef uint32_t pastix_uint_t;
--

when I run "make install". Here is the diff between my config.in and MAC.in:

--
$ diff config.in config/MAC.in
26c26
< EXTRALIB=-L/usr/local/opt/gfortran/gfortran/lib -lgfortran -lm
---
> EXTRALIB = -lgfortran -lm
39,42c39,42
< ROOT=/usr/local/Cellar/pastix/5.2
< INCLUDEDIR=/usr/local/Cellar/pastix/5.2/include
< LIBDIR=/usr/local/Cellar/pastix/5.2/lib
< BINDIR=/usr/local/Cellar/pastix/5.2/bin
---
> # ROOT = /path/to/install/directory
> # INCLUDEDIR = ${ROOT}/include
> # LIBDIR = ${ROOT}/lib
> # BINDIR = ${ROOT}/bin
47,52c47,52
< SHARED=1
< SOEXT = .dylib
< SHARED_FLAGS=-shared
< CCFDEB := ${CCFDEB} -fPIC
< CCFOPT := ${CCFOPT} -fPIC
< CFPROG := ${CFPROG} -fPIC
---
> #SHARED=1
> #SOEXT=.dylib
> #SHARED_FLAGS = -shared -Wl,-dylib_install_name -Wl,__SO_NAME__
> #CCFDEB := ${CCFDEB} -fPIC
> #CCFOPT := ${CCFOPT} -fPIC
> #CFPROG := ${CFPROG} -fPIC
62,63c62,63
< VERSIONINT = _int32
< CCTYPES = -DINTSIZE32
---
> #VERSIONINT = _int32
> #CCTYPES = -DINTSIZE32
155c155
< SCOTCH_HOME=/usr/local/Cellar/scotch5/5.1.12b
---
> SCOTCH_HOME ?= ${HOME}/scotch_5.1/
--

Thanks!

RE: Compilation on OSX: duplicate symbols [ Reply ]
By: Xavier Lacoste on 2013-09-10 07:50
[forum:147723]
Hello,

Yes I undertand this issue, it has been fixed in trunk branch.
I will backport it in 5.2.1 release, you can get it via SVN :

svn co svn://scm.gforge.inria.fr/svnroot/ricar/tags/5.2.1

I will create a new release tarball once your brew recipe is working so that it'll be up to date.

The corresponding patch :
commit c8148cb1250c190746665fb424780dd59092e061
Author: lacoste <lacoste@5f9d6cf8-0d07-0410-afad-9b50a97d579d>
Date: Thu Feb 7 15:47:03 2013 +0000

FIX: u_int[32,64]_t becomes uint[32,64]_t (Thanks to Garth Wells for reporting and giving fix)

git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/ricar/trunk@4032 5f9d6cf8-0d07-0410-afad-9b50a97d579d

diff --git a/common/src/common_pastix.h b/common/src/common_pastix.h
index fedb76f..f58102d 100644
--- a/common/src/common_pastix.h
+++ b/common/src/common_pastix.h
@@ -297,11 +297,11 @@
# define COMM_INT MPI_LONG
#elif (defined FORCE_INT32)
# define INT int32_t
-# define UINT u_int32_t
+# define UINT uint32_t
# define COMM_INT MPI_INTEGER4
#elif (defined FORCE_INT64)
# define INT int64_t
-# define UINT u_int64_t
+# define UINT uint64_t
# define COMM_INT MPI_INTEGER8
#else
# define INT int /* Default integer type */
diff --git a/utils/src/genheader.c b/utils/src/genheader.c
index a91acae..1f3c4ae 100644
--- a/utils/src/genheader.c
+++ b/utils/src/genheader.c
@@ -96,12 +96,12 @@ int main (int argc, char ** argv)
#else
#ifdef FORCE_INT32
fprintf(file, "typedef int32_t pastix_int_t;\n");
- fprintf(file, "typedef u_int32_t pastix_uint_t;\n");
+ fprintf(file, "typedef uint32_t pastix_uint_t;\n");
fprintf(file, "# define MPI_PASTIX_INT MPI_INTEGER4\n");
#else
#ifdef FORCE_INT64
fprintf(file, "typedef int64_t pastix_int_t;\n");
- fprintf(file, "typedef u_int64_t pastix_uint_t;\n");
+ fprintf(file, "typedef uint64_t pastix_uint_t;\n");
fprintf(file, "# define MPI_PASTIX_INT MPI_INTEGER8\n");
#else
fprintf(file, "typedef int pastix_int_t;\n");

RE: Compilation on OSX: duplicate symbols [ Reply ]
By: Dominique Orban on 2013-09-09 19:50
[forum:147722]
Hi,

Yes, the plan is to add the formula to homebrew/science when it's solid. I'm still ironing out a few problems. The current dependencies are Metis v4 and Scotch v5. By default, I use the BLAS that ships with OSX (the so-called "Accelerate" framework) but users can elect to use OpenBLAS, which is installable via Homebrew.

Now I've run into the following issue. I had to set VERSIONINT to _int32 because of the way PETSc was compiled (at least I think that's why). But when I #include <pastix.h>, I get the following error message:

/usr/local/Cellar/pastix/5.2.1r4030/include/pastix.h:4:1: error: unknown type name 'u_int32_t'

I'm not sure what's wrong here. Does it look obvious to you?

Thanks!

RE: Compilation on OSX: duplicate symbols [ Reply ]
By: Xavier Lacoste on 2013-09-04 07:09
[forum:147720]
Hello,

And my bad also, I was looking into master and not release ;)

Thanks, for your work on adding PaStiX to homebrew if you need some more help please contact me.

Are you adding it to homebrew/science/ as it has been done with scotch ?
With dependencies on MPI/hwloc/scotch/ with witch BLAS ?

Thanks again,

XL.

RE: Compilation on OSX: duplicate symbols [ Reply ]
By: Dominique Orban on 2013-09-03 21:54
[forum:147719]
My bad. All is well with release 4030. Sorry for the noise. I was a bit confused by the fact that the oldest release appears first on the download page.

Thanks for the prompt reply!

RE: Compilation on OSX: duplicate symbols [ Reply ]
By: Dominique Orban on 2013-09-03 18:35
[forum:147718]
Hi,

Thanks for the quick reply. The file `mmread.h` has no such line; it only contains the function prototype. Same thing about `mmdread.h`. I'm using release 3945.

I found the line

#define MatrixMarketRead PASTIX_PREFIX(MatrixMarketRead)

in `common_drivers.h`, but there is nothing about `DistributedMatrixMarketRead`.

Should I be using another release?

Thank you!

RE: Compilation on OSX: duplicate symbols [ Reply ]
By: Xavier Lacoste on 2013-09-03 07:27
[forum:147715]
Hello,

Could you please go into matrix_drivers/src/mmread.h and change

#define DistributedMatrixMarketRead PASTIX_PREFIX(DistributedMatrixMarketRead)

by

#define DistributedMatrixMarketRead PASTIX_PREFIX_F(DistributedMatrixMarketRead)

I think it should solve this issue.

Can you tell me if it works, in this case I'll fix the sources.

Thanks for your report,

XL.

Compilation on OSX: duplicate symbols [ Reply ]
By: Dominique Orban on 2013-09-03 01:12
[forum:147714]

config.in (13) downloads
I'm compiling Pastix on OSX 10.8.4. The idea is to write a Homebrew (www.brew.sh) formula to ease the pain of Mac users. Compilation goes well but when I run `make install`, I get a failure when building `libmatrix_driver.dylib` with the following message:

--
duplicate symbol _DistributedMatrixMarketRead in:
matrix_drivers/obj/i686_mac/mmdread.o
matrix_drivers/obj/i686_mac/mmdread_s.o
duplicate symbol _DistributedMatrixMarketRead in:
matrix_drivers/obj/i686_mac/mmdread.o
matrix_drivers/obj/i686_mac/mmdread_d.o
duplicate symbol _DistributedMatrixMarketRead in:
matrix_drivers/obj/i686_mac/mmdread.o
matrix_drivers/obj/i686_mac/mmdread_c.o
duplicate symbol _DistributedMatrixMarketRead in:
matrix_drivers/obj/i686_mac/mmdread.o
matrix_drivers/obj/i686_mac/mmdread_z.o
ld: 4 duplicate symbols for architecture x86_64
--

Installing by hand fails with the same message. I attach my config.in below.

Any ideas?

Thanks!