astamm / nloptr

nloptr provides an R interface to NLopt, a free/open-source library for nonlinear optimization providing a common interface to a number of different optimization routines which can handle nonlinear constraints and lower and upper bounds for the controls.
https://astamm.github.io/nloptr/
Other
105 stars 35 forks source link

issues on AIX #14

Closed vinhdizzo closed 2 years ago

vinhdizzo commented 9 years ago

Trying to install nloptr on AIX with R 3.2.2 compiled with gcc. I was able to install nlopt first, and then launching R with the environment variable CPATH=/sas/outmva/opt/include in order to make the header file accessible.

However, I'm getting the following. Would you have any suggestions on getting this to work? Thanks.

> install.packages('nloptr')
trying URL 'http://cran.revolutionanalytics.com/src/contrib/nloptr_1.0.4.tar.gz'
Content type 'application/octet-stream' length 353942 bytes (345 KB)
==================================================
downloaded 345 KB

* installing *source* package 'nloptr' ...
** package 'nloptr' successfully unpacked and MD5 sums checked
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking for pkg-config... yes
configure: Now testing for NLopt header file.
checking for grep that handles long lines and -e... /opt/freeware/bin/grep
checking for egrep... /opt/freeware/bin/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 nlopt.h usability... yes
checking nlopt.h presence... yes
checking for nlopt.h... yes
configure: Suitable NLopt library found.
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -I/sas/outmva/opt/lib/R/include -DNDEBUG  -I/usr/local/include
 -g -O2  -c dummy.cpp -o dummy.o
gcc -std=gnu99 -I/sas/outmva/opt/lib/R/include -DNDEBUG
-I/usr/local/include  -mno-fp-in-toc    -g -O2  -c nloptr.c -o
nloptr.o
g++ -shared -Wl,-brtl -Wl,-G -Wl,-bexpall -Wl,-bnoentry -lc
-L/usr/local/lib -o nloptr.so dummy.o nloptr.o -lm -lintl
installing to /sas/outmva/opt/lib/R/library/nloptr/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object
'/sas/outmva/opt/lib/R/library/nloptr/libs/nloptr.so':
  rtld: 0712-001 Symbol nlopt_create was referenced
      from module
/sas/outmva/opt/lib/R/library/nloptr/libs/nloptr.so(), but a runtime
definition
            of the symbol was not found.
rtld: 0712-001 Symbol nlopt_set_stopval was referenced
      from module
/sas/outmva/opt/lib/R/library/nloptr/libs/nloptr.so(), but a runtime
definition
            of the symbol was not found.
rtld: 0712-001 Symbol nlopt_set_ftol_rel was referenced
      from module
/sas/outmva/opt/lib/R/library/nloptr/libs/nloptr.so(), but a runtime
definition
            of the symbol was not found.
rtld: 0712-001 Symbol nlopt_set_ftol_abs was referenced
      from module
/sas/outmva/opt/lib/R/library/nloptr/libs/nloptr.so(), but a runtime
definition
            of the symbol was not found.
rtld: 0712-001 Symbol nlopt_set_xtol_rel was referenced
      from module
/sas/outmva/opt/lib/R/library/nloptr/libs/nloptr.so(), but a runtime
definition
            of the sy
Error: loading failed
Execution halted
ERROR: loading failed
* removing '/sas/outmva/opt/lib/R/library/nloptr'

The downloaded source packages are in
        '/tmp/Rtmp5yvama/downloaded_packages'
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("nloptr") :
  installation of package 'nloptr' had non-zero exit status
aixtools commented 9 years ago

after these commands

g++ -shared -Wl,-brtl -Wl,-G -Wl,-bexpall -Wl,-bnoentry -lc -L/usr/local/lib -o nloptr.so dummy.o nloptr.o -lm -lintl installing to /sas/outmva/opt/lib/R/library/nloptr/libs

the file /sas/outmva/opt/lib/R/library/nloptr/libs/nloptr.so should exist

During the next phase rtld (runtime loader) is trying to use it for something.

On AIX - you check any libraries it is going to search - and determine whether these should be external - as the linker is trying, or should they be internal.

to see where AIX linker is looking, by default - use the command

dump -H /sas/outmva/opt/lib/R/library/nloptr/libs/nloptr.so

if the external library you need is there, but not it's path - for a quick solution add a symbolic link from somewhere AIX is looking to where the library actually is. If that works THEN you can look for a better solution (e.g., adding -blibpath argument to nloptr.so, or modifying an incorrect -blibpath)

vinhdizzo commented 9 years ago

@aixtools Here's the output to dump -H nloptr.so:

nloptr.so:

                        ***Loader Section***
                      Loader Header Information
VERSION#         #SYMtableENT     #RELOCent        LENidSTR
0x00000001       0x0000003c       0x00000063       0x000000b3

#IMPfilID        OFFidSTR         LENstrTBL        OFFstrTBL
0x00000004       0x00000a64       0x000003dd       0x00000b17

                        ***Import File Strings***
INDEX  PATH                          BASE                MEMBER
0      /usr/local/lib:/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.3:/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.3/../../..:/usr/lib:/lib              
1                                    libc.a              shr.o
2                                    libgcc_s.a          shr.o
3                                    ..

Should it include /sas/outmva/opt/lib? Any thoughts on what's going on? Thanks.

vinhdizzo commented 9 years ago

Here are the results from dump -Tv:

nloptr.so:

                        ***Loader Section***

                        ***Loader Symbol Table Information***
[Index]      Value      Scn     IMEX Sclass   Type           IMPid Name

[0]     0x20000ab4    .data              RW SECdef        [noIMid] __rtinit
[1]     0x00000000    undef      IMP     DS EXTref libgcc_s.a(shr.o) __cxa_final
ize
[2]     0x00000000    undef      IMP     RW EXTref   libc.a(shr.o) _DBLINF
[3]     0x20000aa0    .data      EXP     RW   Ldef        [noIMid] __dso_handle
[4]     0x20000b20    .data      EXP     DS   Ldef        [noIMid] __init_aix_li
bgcc_cxa_atexit
[5]     0x20000b2c    .data      EXP     DS   Ldef        [noIMid] _GLOBAL__D_65
535_0___dso_handle
[6]     0x20000b38    .data      EXP     DS   Ldef        [noIMid] _GLOBAL__FI_n
loptr_so
[7]     0x20000b44    .data      EXP     DS   Ldef        [noIMid] _GLOBAL__FD_n
loptr_so
[8]     0x20000b50    .data      EXP     DS   Ldef        [noIMid] _GLOBAL__DI
[9]     0x20000b5c    .data      EXP     DS   Ldef        [noIMid] _GLOBAL__DD
[10]    0x20000b68    .data      EXP     DS SECdef        [noIMid] strcmp
[11]    0x20000b70    .data      EXP     DS   Ldef        [noIMid] getListElement
[12]    0x20000b7c    .data      EXP     DS   Ldef        [noIMid] func_objective
[13]    0x20000b88    .data      EXP     DS   Ldef        [noIMid] func_constraints_ineq
[14]    0x20000b94    .data      EXP     DS   Ldef        [noIMid] func_constraints_eq
[15]    0x20000ba0    .data      EXP     DS   Ldef        [noIMid] getAlgorithmCode
[16]    0x20000bac    .data      EXP     DS   Ldef        [noIMid] getOptions
[17]    0x20000bb8    .data      EXP     DS   Ldef        [noIMid] convertStatusToMessage
[18]    0x20000bc4    .data      EXP     DS   Ldef        [noIMid] NLoptR_Optimize
[19]    0x00000000    undef      IMP     DS EXTref              .. Rf_getAttrib
[20]    0x00000000    undef      IMP     DS EXTref              .. STRING_ELT
[21]    0x00000000    undef      IMP     DS EXTref              .. R_CHAR
[22]    0x00000000    undef      IMP     DS EXTref              .. Rf_length
[23]    0x00000000    undef      IMP     DS EXTref              .. VECTOR_ELT
[24]    0x00000000    undef      IMP     DS EXTref              .. R_CheckUserInterrupt
[25]    0x00000000    undef      IMP     DS EXTref              .. Rprintf
[26]    0x00000000    undef      IMP     DS EXTref              .. Rf_allocVector
[27]    0x00000000    undef      IMP     DS EXTref              .. REAL
[28]    0x00000000    undef      IMP     DS EXTref              .. Rf_lang2
[29]    0x00000000    undef      IMP     DS EXTref              .. Rf_protect
[30]    0x00000000    undef      IMP     DS EXTref              .. Rf_eval
[31]    0x00000000    undef      IMP     DS EXTref              .. Rf_isNumeric
[32]    0x00000000    undef      IMP     DS EXTref              .. Rf_unprotect
[33]    0x00000000    undef      IMP     DS EXTref              .. nlopt_create
[34]    0x00000000    undef      IMP     DS EXTref              .. nlopt_set_stopval
[35]    0x00000000    undef      IMP     DS EXTref              .. nlopt_set_ftol_rel
[36]    0x00000000    undef      IMP     DS EXTref              .. nlopt_set_ftol_abs
[37]    0x00000000    undef      IMP     DS EXTref              .. nlopt_set_xtol_rel
[38]    0x00000000    undef      IMP     DS EXTref              .. nlopt_set_xtol_abs
[39]    0x00000000    undef      IMP     DS EXTref              .. Rf_coerceVector
[40]    0x00000000    undef      IMP     DS EXTref              .. INTEGER
[41]    0x00000000    undef      IMP     DS EXTref              .. nlopt_set_max
eval
[42]    0x00000000    undef      IMP     DS EXTref              .. nlopt_set_maxtime
[43]    0x00000000    undef      IMP     DS EXTref              .. nlopt_set_population
[44]    0x00000000    undef      IMP     DS EXTref              .. nlopt_srand
[45]    0x00000000    undef      IMP     DS EXTref              .. Rf_mkChar
[46]    0x00000000    undef      IMP     DS EXTref              .. SET_STRING_ELT
[47]    0x00000000    undef      IMP     DS EXTref              .. nlopt_set_local_optimizer
[48]    0x00000000    undef      IMP     DS EXTref              .. nlopt_set_lower_bounds
[49]    0x00000000    undef      IMP     DS EXTref              .. nlopt_set_upper_bounds
[50]    0x00000000    undef      IMP     DS EXTref              .. nlopt_set_min_objective
[51]    0x00000000    undef      IMP     DS EXTref              .. nlopt_destroy
[52]    0x00000000    undef      IMP     DS EXTref              .. nlopt_version
[53]    0x00000000    undef      IMP     DS EXTref              .. Rf_setAttrib
[54]    0x00000000    undef      IMP     DS EXTref              .. SET_VECTOR_ELT
[55]    0x00000000    undef      IMP     DS EXTref              .. nlopt_add_ine
quality_mconstraint
[56]    0x00000000    undef      IMP     DS EXTref              .. nlopt_add_equality_mconstraint
[57]    0x00000000    undef      IMP     DS EXTref              .. nlopt_optimize
[58]    0x00000000    undef      IMP     PR EXTref              .. R_NamesSymbol
[59]    0x00000000    undef      IMP     PR EXTref              .. R_NilValue

Any thoughts on how this could be fixed @aixtools?

aixtools commented 9 years ago

The error message (one of them) is literally this: rtld: 0712-001 Symbol nlopt_create was referenced from module /sas/outmva/opt/lib/R/library/nloptr/libs/nloptr.so(), but a runtime definition of the symbol was not found.

All on one line for emphasis.

Which library has nlopt_create - find that library/shared_archive and copy it to, e.g., /usr/local/lib

If the message goes away after that, then the "problem" is that before starting R to compile and install the module, I recommend adding LDFLAGS=-L/where/the/archive/is/normally - and try again. Ideally, dump -H will also show /where/the/archive/is/normally in it's output.

So, first find the shared object (.so) or shared library (.a with members) that resolve nlopt_create - and others.

FYI - I am working on packaging R for AIX - separate from commercial packaging - and my goal is to make sure that R knows where to put things. But first I am helping a colleague get something working. IF that is successful I expect to make my packaging avaliable. My expertise is AIX, not R.

aixtools commented 9 years ago

As an experiment I tried to install the module - with no success. Aparently it makes several assumptions about where to find things - e.g., include files - and when these assumptions are not met, install fails.

In my case - it looks like:

output from wget to pick up the module << nloptr_1.0.4.tar.gz 100%[============================================================>] 345.65K 511KB/s in 0.7s

2015-10-13 22:23:22 (511 KB/s) - 'nloptr_1.0.4.tar.gz' saved [353942/353942]

root@x072:[/data/prj/cran/modules]wget http://cran.r-project.org/src/contrib/nloptr_1.0.4.tar.gz root@x072:[/data/prj/cran/modules]R CMD INSTALL nloptr_1.0.4.tar.gz

configure: Starting to install library to /tmp/RtmpuTp1Cn/R.INSTALLd1002e3a861639/nloptr/nlopt-2.4.2 ./configure[3325]: syntax error at line 1 : `<' unexpected \ libs g++ -I/opt/lib/R/include -DNDEBUG -I/usr/local/include -g -O2 -c dummy.cpp -o dummy.o gcc -std=gnu99 -I/opt/lib/R/include -DNDEBUG -I/usr/local/include -mno-fp-in-toc -g -O2 -c nloptr.c -o nloptr.o nloptr.c:42:19: fatal error: nlopt.h: A file or directory in the path name does not exist. compilation terminated. make: The error code from the last command is 1.

Stop. ERROR: compilation failed for package 'nloptr'

aixtools commented 9 years ago

(Unfortunately, I do not know the format commands, so above ran together) - sigh.

vinhdizzo commented 9 years ago

Yes, what you just tried (R CMD INSTALL) also fails for me. To get around thay, I compile nlopt (C) first. Then you can do

CPATH=/path to nlopt header/ R CMD INSTALL NLOPTR

To get what I had originally.

Now, to your previous suggestion. I dont have root access so I cant create a symlink. However, I will try LDFLAGs and point to libnlopt.a. Will do in a couple of hours. You could also try that with my CPATH suggestion too of you are going to retry.

Thanks so much for your help.

vinhdizzo commented 9 years ago

@aixtools nlopt (C library) is installed at /sas/outmva/opt/[include,lib]. Here's the error I get:

$ CPATH=/sas/outmva/opt/include LDFLAGS=-L/sas/outmva/opt/lib R CMD INSTALL nloptr_1.0.4.tar.gz
* installing to library '/sas/outmva/opt/lib/R/library'
* installing *source* package 'nloptr' ...
** package 'nloptr' successfully unpacked and MD5 sums checked
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking for pkg-config... yes
configure: Now testing for NLopt header file.
checking for grep that handles long lines and -e... /opt/freeware/bin/grep
checking for egrep... /opt/freeware/bin/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 nlopt.h usability... yes
checking nlopt.h presence... yes
checking for nlopt.h... yes
configure: Suitable NLopt library found.
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -maix64 -pthread -I/sas/outmva/opt/lib/R/include -DNDEBUG  -I/usr/local/include      -g -O2  -c dummy.cpp -o dummy.o
gcc -maix64 -pthread -std=gnu99 -I/sas/outmva/opt/lib/R/include -DNDEBUG  -I/usr/local/include  -mminimal-toc    -O2 -g -mcpu=power6  -c nloptr.c -o nloptr.o
g++ -maix64 -pthread -shared -Wl,-brtl -Wl,-G -Wl,-bexpall -Wl,-bnoentry -lc -L/usr/local/lib -o nloptr.so dummy.o nloptr.o -lm -lintl
installing to /sas/outmva/opt/lib/R/library/nloptr/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object '/sas/outmva/opt/lib/R/library/nloptr/libs/nloptr.so':
  rtld: 0712-001 Symbol nlopt_create was referenced
      from module /sas/outmva/opt/lib/R/library/nloptr/libs/nloptr.so(), but a runtime definition
            of the symbol was not found.
...

Same error as before. The LDFLAGS was not passed. Now, if I extract nloptr.tar.gz and compile from source (in src directory) and adding in the flag manually, I get:

-bash-4.2$ g++ -maix64 -pthread -I/sas/outmva/opt/lib/R/include -DNDEBUG  -I/usr/local/include      -g -O2  -c dummy.cpp -o dummy.o
-bash-4.2$ CPATH=/sas/outmva/opt/include LDFLAGS=-L/sas/outmva/opt/lib gcc -maix64 -pthread -std=gnu99 -I/sas/outmva/opt/lib/R/include -DNDEBUG  -I/usr/local/include  -mminimal-toc    -O2 -g -mcpu=power6  -c nloptr.c -o nloptr.o
-bash-4.2$ g++ -maix64 -pthread -shared -Wl,-brtl -Wl,-G -Wl,-bexpall -Wl,-bnoentry -lc -L/usr/local/lib -L/sas/outmva/opt/lib -o nloptr.so dummy.o nloptr.o -lm -lintl

Then, if I launch R and load the so file, I get:

> dyn.load('nloptr.so')
Error in dyn.load("nloptr.so") :
  unable to load shared object '/sas/data04/vinh/nloptr/src/nloptr.so':
  rtld: 0712-001 Symbol nlopt_create was referenced
      from module /sas/data04/vinh/nloptr/src/nloptr.so(), but a runtime definition
            of the symbol was not found.

I actually exchanged emails with the author of nloptr (R) last week, and we found this and this. I asked for some help with exporting variable names over here and tried a few things with -bexpfull, but still no go.

I didn't bring these points up previously because I thought you ran into the rtld errors many times in the past on AIX and thought my previous findings were irrelevant. Apologies. Hope this paints a clearer picture.

I know you are not an R expert, so I'm willing to test things out so long as you give me ideas for getting this resolved. I have other errors (to come later) to debug for other R packages on AIX. Thanks again.

aixtools commented 9 years ago

On 2015-10-13 17:08, Vinh Nguyen wrote:

[33] 0x00000000 undef IMP DS EXTref .. nlopt_create So, this is the undef(ined) symbol that needs resolution. As I still do not know how this symbol is used I shall research by unpacking the package.

I am unsure what package I should be debugging - the package I found via google is nloptr_1.0.4.tar.gz, but that seems to load nlopt-2.4.2.tar.gz. Guessing this is the one that is vital I shall try to use the URL INSTALL shows: configure: Need to download and build NLopt trying URL 'http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz' Content type 'application/x-gzip' length 2361992 bytes (2.3 MB)

And see what is in that.

How I can I tell R to install from an unpacked directory (where I have already prepared the archive)?

re:

I actually exchanged emails with the author of nloptr (R) last week, and we found this and this. I asked for some help with exporting variable names over here and tried a few things with -bexpfull, but still no go.

Generally, AIX and xlC, gcc, ld, etc. export all symbols. I have never had to do anything extra when building from source. When I have needed to use an export file is when I needed a symbol from the kernel that is not normally exported. From memory, the Apache HTTPD project does some symbol exporting (back from when it was necessary) - so that will give me something to look at.

Going back over 20 years - the easiest way to create this situation was to have an include file that defined the symbol as external but in the code as static. However, even if defined as static, there would be some value in the .o, .so, or .a file.

Let's start with a very simple "function" - static linking.

root@x072:[/data/prj/cran/modules]cat ref.c static myInternalFunc() { ; }

extern myExternalFunc() { ; }

After compiling, nm shows the symbol definitions, but as it is static, dump cannot show loader data. This will be the same for the "main" program - except the nm will show that the external reference is unknown.

root@x072:[/data/prj/cran/modules]gcc -c ref.c root@x072:[/data/prj/cran/modules]nm ref.o .myExternalFunc T 64 .myInternalFunc t 0 TOC d 164 myExternalFunc D 140 myExternalFunc d 140 12 myInternalFunc d 128 12 ref.c f - root@x072:[/data/prj/cran/modules]dump -Tv ref.o

ref.o:

Loader section is not available root@x072:[/data/prj/cran/modules]cat ref_main.c main() { myExternalFunc(); }

root@x072:[/data/prj/cran/modules]gcc -c ref_main.c

root@x072:[/data/prj/cran/modules]nm ref_main.o .main T 0 .myExternalFunc U - TOC d 100 main D 76 main d 76 12 ref_main.c f -

root@x072:[/data/prj/cran/modules]gcc ref_main.o ref.o

a.out has been linked - note, dump shows nothing about "static" resolved references. To see those, again, nm must be used.

root@x072:[/data/prj/cran/modules]dump -Tv a.out a.out:

                     ***Loader Section***

                     ***Loader Symbol Table Information***

[Index] Value Scn IMEX Sclass Type IMPid Name

[0] 0x00000000 undef IMP RW EXTref libc.a(shr.o) errno [1] 0x00000000 undef IMP DS EXTref libc.a(shr.o) exit [2] 0x00000000 undef IMP DS EXTref libc.a(shr.o) mod_init [3] 0x00000000 undef IMP RW EXTref libc.a(shr.o) crt0v [4] 0x00000000 undef IMP RW EXTref libc.a(shr.o) malloc_user_d efined_name [5] 0x20000508 .data ENTpt DS SECdef [noIMid] start

root@x072:[/data/prj/cran/modules]nm a.out | grep my .myExternalFunc T 268436492 .myInternalFunc t 268436428 root@x072:[/data/prj/cran/modules]

dump -Tv shows external symbols that must be imported, and under IMPid shows the library and member name that is expected to resolve it.

The dump -H output shows the default LIBPATH in the program (note, each shared library has it's own LIBPATH that may have other or additional directories to search - entry:0

For a.out we see that the library libc.a will be used to find the member shr.o

root@x072:[/data/prj/cran/modules]dump -H a.out

a.out:

                     ***Loader Section***
                   Loader Header Information

VERSION# #SYMtableENT #RELOCent LENidSTR 0x00000001 0x00000006 0x0000000d 0x0000007b

IMPfilID OFFidSTR LENstrTBL OFFstrTBL

0x00000002 0x0000014c 0x0000002a 0x000001c7

                     ***Import File Strings***

INDEX PATH BASE MEMBER 0 /opt/lib/gcc/powerpc-ibm-aix5.3.0.0/4.7.4:/opt/lib/gcc/powerpc-ibm-aix5.3.0.0/4.7.4/../../..:/usr/lib:/lib 1 libc.a shr.o

For additional detail (i.e., how paths can change and how dynamic and static members can be in the same archive)

root@x072:[/data/prj/cran/modules]dump -H /usr/lib/libc.a

/usr/lib/libc.a[frexp.o]:

Loader section is not available

/usr/lib/libc.a[itrunc.o]:

Loader section is not available

/usr/lib/libc.a[ldexp.o]:

Loader section is not available

/usr/lib/libc.a[modf.o]:

Loader section is not available

/usr/lib/libc.a[logb.o]:

Loader section is not available

/usr/lib/libc.a[scalb.o]:

Loader section is not available

/usr/lib/libc.a[finite.o]:

Loader section is not available

/usr/lib/libc.a[uitrunc.o]:

Loader section is not available

/usr/lib/libc.a[_itrunc.o]:

Loader section is not available

/usr/lib/libc.a[_uitrunc.o]:

Loader section is not available

/usr/lib/libc.a[fstab.o]:

Loader section is not available

/usr/lib/libc.a[getttyent.o]:

Loader section is not available

/usr/lib/libc.a[getttynam.o]:

Loader section is not available

/usr/lib/libc.a[fill.o]:

Loader section is not available

/usr/lib/libc.a[strcat.o]:

Loader section is not available

/usr/lib/libc.a[strcpy.o]:

Loader section is not available

/usr/lib/libc.a[strcmp.o]:

Loader section is not available

/usr/lib/libc.a[strncat.o]:

Loader section is not available

/usr/lib/libc.a[strncpy.o]:

Loader section is not available

/usr/lib/libc.a[__set_errno128.o]:

Loader section is not available

/usr/lib/libc.a[move.o]:

Loader section is not available

/usr/lib/libc.a[moveeq.o]:

Loader section is not available

/usr/lib/libc.a[memset.o]:

Loader section is not available

/usr/lib/libc.a[_qint.o]:

Loader section is not available

/usr/lib/libc.a[_qitrunc.o]:

Loader section is not available

/usr/lib/libc.a[_qnint.o]:

Loader section is not available

/usr/lib/libc.a[_setflm.o]:

Loader section is not available

/usr/lib/libc.a[_xlqadd.o]:

Loader section is not available

/usr/lib/libc.a[_xlqdiv.o]:

Loader section is not available

/usr/lib/libc.a[_xlqmul.o]:

Loader section is not available

/usr/lib/libc.a[_xlqsub.o]:

Loader section is not available

/usr/lib/libc.a[fsavres.o]:

Loader section is not available

/usr/lib/libc.a[longjmp.o]:

Loader section is not available

/usr/lib/libc.a[maxi64.o]:

Loader section is not available

/usr/lib/libc.a[mini64.o]:

Loader section is not available

/usr/lib/libc.a[multi64.o]:

Loader section is not available

/usr/lib/libc.a[compi64.o]:

Loader section is not available

/usr/lib/libc.a[compu64.o]:

Loader section is not available

/usr/lib/libc.a[llabs.o]:

Loader section is not available

/usr/lib/libc.a[_quitrunc.o]:

Loader section is not available

/usr/lib/libc.a[gsavres.o]:

Loader section is not available

/usr/lib/libc.a[clc.o]:

Loader section is not available

/usr/lib/libc.a[vsaveres.o]:

Loader section is not available

/usr/lib/libc.a[ptrgl.o]:

Loader section is not available

/usr/lib/libc.a[shr.o]:

                     ***Loader Section***
                   Loader Header Information

VERSION# #SYMtableENT #RELOCent LENidSTR 0x00000001 0x00000d33 0x00003fee 0x0000002a

IMPfilID OFFidSTR LENstrTBL OFFstrTBL

0x00000003 0x00043c10 0x00008383 0x00043c3a

                     ***Import File Strings***

INDEX PATH BASE MEMBER 0 /usr/lib:/lib 1 / unix 2 libcrypt.a shr.o

/usr/lib/libc.a[meth.o]:

                     ***Loader Section***
                   Loader Header Information

VERSION# #SYMtableENT #RELOCent LENidSTR 0x00000001 0x00000002 0x00000000 0x0000001e

IMPfilID OFFidSTR LENstrTBL OFFstrTBL

0x00000002 0x00000050 0x0000003b 0x0000006e

                     ***Import File Strings***

INDEX PATH BASE MEMBER 0 /usr/lib:/lib 1 libc.a shr.o

/usr/lib/libc.a[posix_aio.o]:

                     ***Loader Section***
                   Loader Header Information

VERSION# #SYMtableENT #RELOCent LENidSTR 0x00000001 0x0000001b 0x00000027 0x00000026

IMPfilID OFFidSTR LENstrTBL OFFstrTBL

0x00000003 0x0000047c 0x0000023e 0x000004a2

                     ***Import File Strings***

INDEX PATH BASE MEMBER 0 /usr/lib:/lib 1 libc.a shr.o 2 / unix

/usr/lib/libc.a[aio.o]:

                     ***Loader Section***
                   Loader Header Information

VERSION# #SYMtableENT #RELOCent LENidSTR 0x00000001 0x00000017 0x00000021 0x00000026

IMPfilID OFFidSTR LENstrTBL OFFstrTBL

0x00000003 0x000003d4 0x00000129 0x000003fa

                     ***Import File Strings***

INDEX PATH BASE MEMBER 0 /usr/lib:/lib 1 libc.a shr.o 2 / unix

/usr/lib/libc.a[pse.o]:

                     ***Loader Section***
                   Loader Header Information

VERSION# #SYMtableENT #RELOCent LENidSTR 0x00000001 0x0000000b 0x0000000b 0x00000026

IMPfilID OFFidSTR LENstrTBL OFFstrTBL

0x00000003 0x000001ac 0x0000004e 0x000001d2

                     ***Import File Strings***

INDEX PATH BASE MEMBER 0 /usr/lib:/lib 1 libc.a shr.o 2 / unix

/usr/lib/libc.a[dl.o]:

                     ***Loader Section***
                   Loader Header Information

VERSION# #SYMtableENT #RELOCent LENidSTR 0x00000001 0x00000004 0x00000000 0x0000001e

IMPfilID OFFidSTR LENstrTBL OFFstrTBL

0x00000002 0x00000080 0x00000019 0x0000009e

                     ***Import File Strings***

INDEX PATH BASE MEMBER 0 /usr/lib:/lib 1 libc.a shr.o

/usr/lib/libc.a[pty.o]:

                     ***Loader Section***
                   Loader Header Information

VERSION# #SYMtableENT #RELOCent LENidSTR 0x00000001 0x00000002 0x00000003 0x00000018

IMPfilID OFFidSTR LENstrTBL OFFstrTBL

0x00000002 0x00000074 0x00000026 0x0000008c

                     ***Import File Strings***

INDEX PATH BASE MEMBER 0 /usr/lib:/lib 1 / unix

/usr/lib/libc.a[cthread.o]:

                     ***Loader Section***
                   Loader Header Information

VERSION# #SYMtableENT #RELOCent LENidSTR 0x00000001 0x00000033 0x0000004c 0x00000038

IMPfilID OFFidSTR LENstrTBL OFFstrTBL

0x00000003 0x00000878 0x00000329 0x000008b0

                     ***Import File Strings***

INDEX PATH BASE MEMBER 0 /usr/lib:/lib 1 libpthreads.a shr_xpg5.o 2 libc.a shr.o

/usr/lib/libc.a[uchar.o]:

                     ***Loader Section***
                   Loader Header Information

VERSION# #SYMtableENT #RELOCent LENidSTR 0x00000001 0x00000018 0x0000001b 0x00000030

IMPfilID OFFidSTR LENstrTBL OFFstrTBL

0x00000003 0x000003a4 0x000000e2 0x000003d4

                     ***Import File Strings***

INDEX PATH BASE MEMBER 0 /usr/lib:/lib 1 libc.a shr.o 2 libiconv.a shr.o root@x072:[/data/prj/cran/modules]

Lastly, try and resolve all shared libraries using the command ldd

root@x072:[/data/prj/cran/modules]ldd ./a.out ./a.out needs: /usr/lib/libc.a(shr.o) /unix /usr/lib/libcrypt.a(shr.o)

When a library is missing, or the wrong library is referenced we get messages like you are seeing:

Working: root@x072:[/data/prj/cran/modules]ldd /opt/lib/R/bin/exec/R /opt/lib/R/bin/exec/R needs: /usr/lib/libc.a(shr.o) /opt/lib/libintl.a(libintl.so.8) /usr/lib/libpthread.a(shr_xpg5.o) /usr/local/lib/libiconv.a(libiconv.so.2) /usr/local/lib/libgomp.a(libgomp.so.1) /usr/lib/librtl.a(shr.o) /unix /usr/lib/libcrypt.a(shr.o) /usr/lib/libpthreads.a(shr_comm.o) /usr/lib/libpthreads.a(shr_xpg5.o) /usr/local/lib/libgcc_s.a(shr.o)

Notice the specified LIBPATH for the archive libintl.a! (index :2) root@x072:[/data/prj/cran/modules]dump -H /opt/lib/R/bin/exec/R

/opt/lib/R/bin/exec/R:

                     ***Loader Section***
                   Loader Header Information

VERSION# #SYMtableENT #RELOCent LENidSTR 0x00000001 0x00000995 0x000029fe 0x00000172

IMPfilID OFFidSTR LENstrTBL OFFstrTBL

0x00000007 0x0002de00 0x000075b6 0x0002df72

                     ***Import File Strings***

INDEX PATH BASE MEMBER 0 /usr/local/lib:/opt/lib/gcc/powerpc-ibm-aix5.3.0.0/4.7.4/pthread:/opt/lib/gcc/powerpc-ibm-aix5.3.0.0/4.7.4/../../../pthread:/opt/lib/gcc/powerpc-ibm-aix5.3.0.0/4.7.4:/opt/lib/gcc/powerpc-ibm-aix5.3.0.0/4.7.4/../../..:/usr/lib:/lib 1 libc.a shr.o 2 /opt/lib libintl.a libintl.so.8 3 libpthread.a shr_xpg5.o 4 libiconv.a libiconv.so.2 5 libgomp.a libgomp.so.1 6 librtl.a shr.o

Now, for the repetition - move /opt/lib/libintl.a and we see:

root@x072:[/data/prj/cran/modules]mv /opt/lib/libintl.a /opt/lib/libintl.a.save root@x072:[/data/prj/cran/modules]/opt/lib/R/bin/exec/R exec(): 0509-036 Cannot load program /opt/lib/R/bin/exec/R because of the following errors: 0509-150 Dependent module /opt/lib/libintl.a(libintl.so.8) could not be loaded. 0509-022 Cannot load module /opt/lib/libintl.a(libintl.so.8). 0509-026 System error: A file or directory in the path name does not exist. root@x072:[/data/prj/cran/modules]ldd /opt/lib/R/bin/exec/R /opt/lib/R/bin/exec/R needs: /usr/lib/libc.a(shr.o) Cannot find /opt/lib/libintl.a(libintl.so.8) /usr/lib/libpthread.a(shr_xpg5.o) /usr/local/lib/libiconv.a(libiconv.so.2) /usr/local/lib/libgomp.a(libgomp.so.1) /usr/lib/librtl.a(shr.o) /unix /usr/lib/libcrypt.a(shr.o) /usr/lib/libpthreads.a(shr_comm.o) /usr/lib/libpthreads.a(shr_xpg5.o) /usr/local/lib/libgcc_s.a(shr.o)

And back

root@x072:[/data/prj/cran/modules]mv /opt/lib/libintl.a.save /opt/lib/libintl.a root@x072:[/data/prj/cran/modules]ldd /opt/lib/R/bin/exec/R /opt/lib/R/bin/exec/R needs: /usr/lib/libc.a(shr.o) /opt/lib/libintl.a(libintl.so.8) /usr/lib/libpthread.a(shr_xpg5.o) /usr/local/lib/libiconv.a(libiconv.so.2) /usr/local/lib/libgomp.a(libgomp.so.1) /usr/lib/librtl.a(shr.o) /unix /usr/lib/libcrypt.a(shr.o) /usr/lib/libpthreads.a(shr_comm.o) /usr/lib/libpthreads.a(shr_xpg5.o) /usr/local/lib/libgcc_s.a(shr.o)

I do not have an example handy showing the literal message you are having, but I hope the principle of what ld/rtld is trying to deal with.

Shortly said, we need to find WHERE these missing definitions are supposed to be defined. What I am thinking is that the library (archive) built has a few members that are static.

What you can do now is try the command nm on the archive, and grep for the symbols that rtld is not finding (e.g., grep nlotp_)

Michael

aixtools commented 9 years ago

On 2015-10-14 12:42, aixtools wrote:

On 2015-10-13 17:08, Vinh Nguyen wrote:

[33] 0x00000000 undef IMP DS EXTref .. nlopt_create So, this is the undef(ined) symbol that needs resolution. As I still do not know how this symbol is used I shall research by unpacking the package.

I am unsure what package I should be debugging - the package I found via google is nloptr_1.0.4.tar.gz, but that seems to load nlopt-2.4.2.tar.gz. Guessing this is the one that is vital I shall try to use the URL INSTALL shows: configure: Need to download and build NLopt trying URL 'http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz' Content type 'application/x-gzip' length 2361992 bytes (2.3 MB)

And see what is in that.

How I can I tell R to install from an unpacked directory (where I have already prepared the archive)?

re:

I actually exchanged emails with the author of nloptr (R) last week, and we found this and this.
I asked for some help with exporting variable names over here and tried a few things with -bexpfull, but still no go.

Generally, AIX and xlC, gcc, ld, etc. export all symbols. I have never had to do anything extra when building from source. When I have needed to use an export file is when I needed a symbol from the kernel that is not normally exported. From memory, the Apache HTTPD project does some symbol exporting (back from when it was necessary) - so that will give me something to look at.

Going back over 20 years - the easiest way to create this situation was to have an include file that defined the symbol as external but in the code as static. However, even if defined as static, there would be some value in the .o, .so, or .a file.

Let's start with a very simple "function" - static linking.

root@x072:[/data/prj/cran/modules]cat ref.c static myInternalFunc() { ; }

extern myExternalFunc() { ; }

After compiling, nm shows the symbol definitions, but as it is static, dump cannot show loader data. This will be the same for the "main" program - except the nm will show that the external reference is unknown.

root@x072:[/data/prj/cran/modules]gcc -c ref.c root@x072:[/data/prj/cran/modules]nm ref.o .myExternalFunc T 64 .myInternalFunc t 0 TOC d 164 myExternalFunc D 140 myExternalFunc d 140 12 myInternalFunc d 128 12 ref.c f - root@x072:[/data/prj/cran/modules]dump -Tv ref.o

ref.o:

Loader section is not available root@x072:[/data/prj/cran/modules]cat ref_main.c main() { myExternalFunc(); }

root@x072:[/data/prj/cran/modules]gcc -c ref_main.c

root@x072:[/data/prj/cran/modules]nm ref_main.o .main T 0 .myExternalFunc U - TOC d 100 main D 76 main d 76 12 ref_main.c f -

root@x072:[/data/prj/cran/modules]gcc ref_main.o ref.o

a.out has been linked - note, dump shows nothing about "static" resolved references. To see those, again, nm must be used.

root@x072:[/data/prj/cran/modules]dump -Tv a.out a.out:

                    ***Loader Section***

                    ***Loader Symbol Table Information***

[Index] Value Scn IMEX Sclass Type IMPid Name

[0] 0x00000000 undef IMP RW EXTref libc.a(shr.o) errno [1] 0x00000000 undef IMP DS EXTref libc.a(shr.o) exit [2] 0x00000000 undef IMP DS EXTref libc.a(shr.o) mod_init [3] 0x00000000 undef IMP RW EXTref libc.a(shr.o) crt0v [4] 0x00000000 undef IMP RW EXTref libc.a(shr.o) malloc_user_d efined_name [5] 0x20000508 .data ENTpt DS SECdef [noIMid] start

root@x072:[/data/prj/cran/modules]nm a.out | grep my .myExternalFunc T 268436492 .myInternalFunc t 268436428 root@x072:[/data/prj/cran/modules]

dump -Tv shows external symbols that must be imported, and under IMPid shows the library and member name that is expected to resolve it.

The dump -H output shows the default LIBPATH in the program (note, each shared library has it's own LIBPATH that may have other or additional directories to search - entry:0

For a.out we see that the library libc.a will be used to find the member shr.o

root@x072:[/data/prj/cran/modules]dump -H a.out

a.out:

                    ***Loader Section***
                  Loader Header Information

VERSION# #SYMtableENT #RELOCent LENidSTR 0x00000001 0x00000006 0x0000000d 0x0000007b

IMPfilID OFFidSTR LENstrTBL OFFstrTBL

0x00000002 0x0000014c 0x0000002a 0x000001c7

                    ***Import File Strings***

INDEX PATH BASE MEMBER 0
/opt/lib/gcc/powerpc-ibm-aix5.3.0.0/4.7.4:/opt/lib/gcc/powerpc-ibm-aix5.3.0.0/4.7.4/../../..:/usr/lib:/lib 1 libc.a shr.o

For additional detail (i.e., how paths can change and how dynamic and static members can be in the same archive)

root@x072:[/data/prj/cran/modules]dump -H /usr/lib/libc.a

/usr/lib/libc.a[frexp.o]:

Loader section is not available

/usr/lib/libc.a[itrunc.o]:

Loader section is not available

/usr/lib/libc.a[ldexp.o]:

Loader section is not available

/usr/lib/libc.a[modf.o]:

Loader section is not available

/usr/lib/libc.a[logb.o]:

Loader section is not available

/usr/lib/libc.a[scalb.o]:

Loader section is not available

/usr/lib/libc.a[finite.o]:

Loader section is not available

/usr/lib/libc.a[uitrunc.o]:

Loader section is not available

/usr/lib/libc.a[_itrunc.o]:

Loader section is not available

/usr/lib/libc.a[_uitrunc.o]:

Loader section is not available

/usr/lib/libc.a[fstab.o]:

Loader section is not available

/usr/lib/libc.a[getttyent.o]:

Loader section is not available

/usr/lib/libc.a[getttynam.o]:

Loader section is not available

/usr/lib/libc.a[fill.o]:

Loader section is not available

/usr/lib/libc.a[strcat.o]:

Loader section is not available

/usr/lib/libc.a[strcpy.o]:

Loader section is not available

/usr/lib/libc.a[strcmp.o]:

Loader section is not available

/usr/lib/libc.a[strncat.o]:

Loader section is not available

/usr/lib/libc.a[strncpy.o]:

Loader section is not available

/usr/lib/libc.a[__set_errno128.o]:

Loader section is not available

/usr/lib/libc.a[move.o]:

Loader section is not available

/usr/lib/libc.a[moveeq.o]:

Loader section is not available

/usr/lib/libc.a[memset.o]:

Loader section is not available

/usr/lib/libc.a[_qint.o]:

Loader section is not available

/usr/lib/libc.a[_qitrunc.o]:

Loader section is not available

/usr/lib/libc.a[_qnint.o]:

Loader section is not available

/usr/lib/libc.a[_setflm.o]:

Loader section is not available

/usr/lib/libc.a[_xlqadd.o]:

Loader section is not available

/usr/lib/libc.a[_xlqdiv.o]:

Loader section is not available

/usr/lib/libc.a[_xlqmul.o]:

Loader section is not available

/usr/lib/libc.a[_xlqsub.o]:

Loader section is not available

/usr/lib/libc.a[fsavres.o]:

Loader section is not available

/usr/lib/libc.a[longjmp.o]:

Loader section is not available

/usr/lib/libc.a[maxi64.o]:

Loader section is not available

/usr/lib/libc.a[mini64.o]:

Loader section is not available

/usr/lib/libc.a[multi64.o]:

Loader section is not available

/usr/lib/libc.a[compi64.o]:

Loader section is not available

/usr/lib/libc.a[compu64.o]:

Loader section is not available

/usr/lib/libc.a[llabs.o]:

Loader section is not available

/usr/lib/libc.a[_quitrunc.o]:

Loader section is not available

/usr/lib/libc.a[gsavres.o]:

Loader section is not available

/usr/lib/libc.a[clc.o]:

Loader section is not available

/usr/lib/libc.a[vsaveres.o]:

Loader section is not available

/usr/lib/libc.a[ptrgl.o]:

Loader section is not available

/usr/lib/libc.a[shr.o]:

                    ***Loader Section***
                  Loader Header Information

VERSION# #SYMtableENT #RELOCent LENidSTR 0x00000001 0x00000d33 0x00003fee 0x0000002a

IMPfilID OFFidSTR LENstrTBL OFFstrTBL

0x00000003 0x00043c10 0x00008383 0x00043c3a

                    ***Import File Strings***

INDEX PATH BASE MEMBER 0 /usr/lib:/lib 1 / unix 2 libcrypt.a shr.o

/usr/lib/libc.a[meth.o]:

                    ***Loader Section***
                  Loader Header Information

VERSION# #SYMtableENT #RELOCent LENidSTR 0x00000001 0x00000002 0x00000000 0x0000001e

IMPfilID OFFidSTR LENstrTBL OFFstrTBL

0x00000002 0x00000050 0x0000003b 0x0000006e

                    ***Import File Strings***

INDEX PATH BASE MEMBER 0 /usr/lib:/lib 1 libc.a shr.o

/usr/lib/libc.a[posix_aio.o]:

                    ***Loader Section***
                  Loader Header Information

VERSION# #SYMtableENT #RELOCent LENidSTR 0x00000001 0x0000001b 0x00000027 0x00000026

IMPfilID OFFidSTR LENstrTBL OFFstrTBL

0x00000003 0x0000047c 0x0000023e 0x000004a2

                    ***Import File Strings***

INDEX PATH BASE MEMBER 0 /usr/lib:/lib 1 libc.a shr.o 2 / unix

/usr/lib/libc.a[aio.o]:

                    ***Loader Section***
                  Loader Header Information

VERSION# #SYMtableENT #RELOCent LENidSTR 0x00000001 0x00000017 0x00000021 0x00000026

IMPfilID OFFidSTR LENstrTBL OFFstrTBL

0x00000003 0x000003d4 0x00000129 0x000003fa

                    ***Import File Strings***

INDEX PATH BASE MEMBER 0 /usr/lib:/lib 1 libc.a shr.o 2 / unix

/usr/lib/libc.a[pse.o]:

                    ***Loader Section***
                  Loader Header Information

VERSION# #SYMtableENT #RELOCent LENidSTR 0x00000001 0x0000000b 0x0000000b 0x00000026

IMPfilID OFFidSTR LENstrTBL OFFstrTBL

0x00000003 0x000001ac 0x0000004e 0x000001d2

                    ***Import File Strings***

INDEX PATH BASE MEMBER 0 /usr/lib:/lib 1 libc.a shr.o 2 / unix

/usr/lib/libc.a[dl.o]:

                    ***Loader Section***
                  Loader Header Information

VERSION# #SYMtableENT #RELOCent LENidSTR 0x00000001 0x00000004 0x00000000 0x0000001e

IMPfilID OFFidSTR LENstrTBL OFFstrTBL

0x00000002 0x00000080 0x00000019 0x0000009e

                    ***Import File Strings***

INDEX PATH BASE MEMBER 0 /usr/lib:/lib 1 libc.a shr.o

/usr/lib/libc.a[pty.o]:

                    ***Loader Section***
                  Loader Header Information

VERSION# #SYMtableENT #RELOCent LENidSTR 0x00000001 0x00000002 0x00000003 0x00000018

IMPfilID OFFidSTR LENstrTBL OFFstrTBL

0x00000002 0x00000074 0x00000026 0x0000008c

                    ***Import File Strings***

INDEX PATH BASE MEMBER 0 /usr/lib:/lib 1 / unix

/usr/lib/libc.a[cthread.o]:

                    ***Loader Section***
                  Loader Header Information

VERSION# #SYMtableENT #RELOCent LENidSTR 0x00000001 0x00000033 0x0000004c 0x00000038

IMPfilID OFFidSTR LENstrTBL OFFstrTBL

0x00000003 0x00000878 0x00000329 0x000008b0

                    ***Import File Strings***

INDEX PATH BASE MEMBER 0 /usr/lib:/lib 1 libpthreads.a shr_xpg5.o 2 libc.a shr.o

/usr/lib/libc.a[uchar.o]:

                    ***Loader Section***
                  Loader Header Information

VERSION# #SYMtableENT #RELOCent LENidSTR 0x00000001 0x00000018 0x0000001b 0x00000030

IMPfilID OFFidSTR LENstrTBL OFFstrTBL

0x00000003 0x000003a4 0x000000e2 0x000003d4

                    ***Import File Strings***

INDEX PATH BASE MEMBER 0 /usr/lib:/lib 1 libc.a shr.o 2 libiconv.a shr.o root@x072:[/data/prj/cran/modules]

Lastly, try and resolve all shared libraries using the command ldd

root@x072:[/data/prj/cran/modules]ldd ./a.out ./a.out needs: /usr/lib/libc.a(shr.o) /unix /usr/lib/libcrypt.a(shr.o)

When a library is missing, or the wrong library is referenced we get messages like you are seeing:

Working: root@x072:[/data/prj/cran/modules]ldd /opt/lib/R/bin/exec/R /opt/lib/R/bin/exec/R needs: /usr/lib/libc.a(shr.o) /opt/lib/libintl.a(libintl.so.8) /usr/lib/libpthread.a(shr_xpg5.o) /usr/local/lib/libiconv.a(libiconv.so.2) /usr/local/lib/libgomp.a(libgomp.so.1) /usr/lib/librtl.a(shr.o) /unix /usr/lib/libcrypt.a(shr.o) /usr/lib/libpthreads.a(shr_comm.o) /usr/lib/libpthreads.a(shr_xpg5.o) /usr/local/lib/libgcc_s.a(shr.o)

Notice the specified LIBPATH for the archive libintl.a! (index :2) root@x072:[/data/prj/cran/modules]dump -H /opt/lib/R/bin/exec/R

/opt/lib/R/bin/exec/R:

                    ***Loader Section***
                  Loader Header Information

VERSION# #SYMtableENT #RELOCent LENidSTR 0x00000001 0x00000995 0x000029fe 0x00000172

IMPfilID OFFidSTR LENstrTBL OFFstrTBL

0x00000007 0x0002de00 0x000075b6 0x0002df72

                    ***Import File Strings***

INDEX PATH BASE MEMBER 0
/usr/local/lib:/opt/lib/gcc/powerpc-ibm-aix5.3.0.0/4.7.4/pthread:/opt/lib/gcc/powerpc-ibm-aix5.3.0.0/4.7.4/../../../pthread:/opt/lib/gcc/powerpc-ibm-aix5.3.0.0/4.7.4:/opt/lib/gcc/powerpc-ibm-aix5.3.0.0/4.7.4/../../..:/usr/lib:/lib 1 libc.a shr.o 2 /opt/lib libintl.a libintl.so.8 3 libpthread.a shr_xpg5.o 4 libiconv.a libiconv.so.2 5 libgomp.a libgomp.so.1 6 librtl.a shr.o

Now, for the repetition - move /opt/lib/libintl.a and we see:

root@x072:[/data/prj/cran/modules]mv /opt/lib/libintl.a /opt/lib/libintl.a.save root@x072:[/data/prj/cran/modules]/opt/lib/R/bin/exec/R exec(): 0509-036 Cannot load program /opt/lib/R/bin/exec/R because of the following errors: 0509-150 Dependent module /opt/lib/libintl.a(libintl.so.8) could not be loaded. 0509-022 Cannot load module /opt/lib/libintl.a(libintl.so.8). 0509-026 System error: A file or directory in the path name does not exist. root@x072:[/data/prj/cran/modules]ldd /opt/lib/R/bin/exec/R /opt/lib/R/bin/exec/R needs: /usr/lib/libc.a(shr.o) Cannot find /opt/lib/libintl.a(libintl.so.8) /usr/lib/libpthread.a(shr_xpg5.o) /usr/local/lib/libiconv.a(libiconv.so.2) /usr/local/lib/libgomp.a(libgomp.so.1) /usr/lib/librtl.a(shr.o) /unix /usr/lib/libcrypt.a(shr.o) /usr/lib/libpthreads.a(shr_comm.o) /usr/lib/libpthreads.a(shr_xpg5.o) /usr/local/lib/libgcc_s.a(shr.o)

And back

root@x072:[/data/prj/cran/modules]mv /opt/lib/libintl.a.save /opt/lib/libintl.a root@x072:[/data/prj/cran/modules]ldd /opt/lib/R/bin/exec/R /opt/lib/R/bin/exec/R needs: /usr/lib/libc.a(shr.o) /opt/lib/libintl.a(libintl.so.8) /usr/lib/libpthread.a(shr_xpg5.o) /usr/local/lib/libiconv.a(libiconv.so.2) /usr/local/lib/libgomp.a(libgomp.so.1) /usr/lib/librtl.a(shr.o) /unix /usr/lib/libcrypt.a(shr.o) /usr/lib/libpthreads.a(shr_comm.o) /usr/lib/libpthreads.a(shr_xpg5.o) /usr/local/lib/libgcc_s.a(shr.o)

I do not have an example handy showing the literal message you are having, but I hope the principle of what ld/rtld is trying to deal with.

Shortly said, we need to find WHERE these missing definitions are supposed to be defined. What I am thinking is that the library (archive) built has a few members that are static.

What you can do now is try the command nm on the archive, and grep for the symbols that rtld is not finding (e.g., grep nlotp_)

Michael

I ran ./configure and make - some warning messages, but all seemed well.

Looking for a shared library (standard on AIX .a files) I found libnlopt.a - but all the members seem to be static:

root@x072:[/data/prj/cran/modules/nlopt-2.4.2]dump -H ./.libs/libnlopt.a

./.libs/libnlopt.a[DIRect.o]:

Loader section is not available

./.libs/libnlopt.a[DIRserial.o]:

Loader section is not available

./.libs/libnlopt.a[DIRsubrout.o]:

Loader section is not available

./.libs/libnlopt.a[direct_wrap.o]:

and so on.

A .so file was not found.

Maybe 'install' is needed to generate a .so file - so

make install DESTDIR=/var/aixtools/modules/nlopt/2.4.2.0

root@x072:[/data/prj/cran/modules/nlopt-2.4.2]find
/var/aixtools/modules/nlopt/2.4.2.0 -name .so root@x072:[/data/prj/cran/modules/nlopt-2.4.2]find
/var/aixtools/modules/nlopt/2.4.2.0 -name
.a /var/aixtools/modules/nlopt/2.4.2.0/usr/local/lib/libnlopt.a root@x072:[/data/prj/cran/modules/nlopt-2.4.2] root@x072:[/data/prj/cran/modules/nlopt-2.4.2]dump -H /var/aixtools/modules/nlopt/2.4.2.0/usr/local/lib/libnlopt.a

/var/aixtools/modules/nlopt/2.4.2.0/usr/local/lib/libnlopt.a[DIRect.o]:

Loader section is not available

/var/aixtools/modules/nlopt/2.4.2.0/usr/local/lib/libnlopt.a[DIRserial.o]:

Loader section is not available

/var/aixtools/modules/nlopt/2.4.2.0/usr/local/lib/libnlopt.a[DIRsubrout.o]:

Loader section is not available

/var/aixtools/modules/nlopt/2.4.2.0/usr/local/lib/libnlopt.a[direct_wrap.o]:

But the symbols are there!

root@x072:[/data/prj/cran/modules/nlopt-2.4.2]nm /var/aixtools/modules/nlopt/2.4.2.0/usr/local/lib/libnlopt.a | grep nlopt_create .nlopt_create U - .nlopt_create U - .nlopt_create U - .nlopt_create U - .nlopt_create T 1584 616 nlopt_create D 11920 nlopt_create d 11920 12 nlopt_create:F539 - 1584

So, my 'fear' is confirmed. The archive is not being assembled as shareable, but static.

I shall so some research. No further action is needed by you atm.

vinhdizzo commented 9 years ago

Thanks @aixtools. Please let me know if you need any assistance from me in testing. As I mentioned, once this piece is fixed, it would show me how to install a lot of the R packages. However, there are more errors and I will post them when we know more about this. Is there a preferred channel to post those? Thanks.

aixtools commented 9 years ago

On 2015-10-14 15:07, Vinh Nguyen wrote:

Thanks @aixtools. Please let me know if you need any assistance from me in testing. As I mentioned, once this piece is fixed, it would show me how to install a lot of the R packages. However, there are more errors and I will post them when we know more about this. Is there a preferred channel to post those? Thanks.


Reply to this email directly or view it on GitHub: https://github.com/jyypma/nloptr/issues/14#issuecomment-148043817 I maintain portal and forums for AIX at http://www.rootvg.net, and http://forums.rootvg.net. Specifically for tools I have a forum at http://forums.rootvg.net/aixtools/ (and since I am sinning by 'promoting' my URL's I also package open-source tools for AIX - with a wiki-like documentation at http://www.aixtools.net.

As to a preferred channel - I would welcome you as a contributer on the aixtools wiki on a page on R, e.g., to document what you have learned. As far as tools are concerned, most of aixtools.net will concern things I have packaged BUT I feel there is still a need for site/portal 'dedicated' to using opensource tools on AIX. Developerworks (IBM site) has had that role, but not consistently. And, I prefer to not post there because they claim too much ownership/control of what gets posted. - Hence, I do my own.

Sigh - a long way to say - for better attention from me, please post to http://forums.rootvg.net/aixtools. Your questions and comments will be another reason for me to improve my gcc package as well as add R to my list.

I'll reply seperately re: my research.

aixtools commented 9 years ago

On 2015-10-14 12:55, aixtools wrote:

On 2015-10-14 12:42, aixtools wrote:

On 2015-10-13 17:08, Vinh Nguyen wrote:

[33] 0x00000000 undef IMP DS EXTref .. nlopt_create So, this is the undef(ined) symbol that needs resolution. As I still do not know how this symbol is used I shall research by unpacking the package.

The short answer is to see if GNU Build tools will create a better ./configure script that also uses libtool knowledge.

I ran ./configure and make - some warning messages, but all seemed well.

Looking for a shared library (standard on AIX .a files) I found libnlopt.a - but all the members seem to be static:

root@x072:[/data/prj/cran/modules/nlopt-2.4.2]dump -H ./.libs/libnlopt.a

./.libs/libnlopt.a[DIRect.o]:

Loader section is not available

./.libs/libnlopt.a[DIRserial.o]:

Loader section is not available

./.libs/libnlopt.a[DIRsubrout.o]:

Loader section is not available

./.libs/libnlopt.a[direct_wrap.o]:

root@x072:[/data/prj/cran/modules/nlopt-2.4.2]dump -H /var/aixtools/modules/nlopt/2.4.2.0/usr/local/lib/libnlopt.a

/var/aixtools/modules/nlopt/2.4.2.0/usr/local/lib/libnlopt.a[DIRect.o]:

Loader section is not available

/var/aixtools/modules/nlopt/2.4.2.0/usr/local/lib/libnlopt.a[DIRserial.o]:

Loader section is not available

/var/aixtools/modules/nlopt/2.4.2.0/usr/local/lib/libnlopt.a[direct_wrap.o]:

But the symbols are there!

root@x072:[/data/prj/cran/modules/nlopt-2.4.2]nm /var/aixtools/modules/nlopt/2.4.2.0/usr/local/lib/libnlopt.a | grep nlopt_create .nlopt_create U - .nlopt_create U - .nlopt_create U - .nlopt_create U - .nlopt_create T 1584 616 nlopt_create D 11920 nlopt_create d 11920 12 nlopt_create:F539 - 1584

So, my 'fear' is confirmed. The archive is not being assembled as shareable, but static.

I shall so some research. No further action is needed by you atm. I have not bothered to create 'exported, shareable' libraries myself. And I do not know libtool well enough to see if it can be done easier these days.

The way it is done now - as performed by libtool (part three of the autoconf, automake, libtool GNU build tools) is to use nm -B to create a list of symbols to export, and then use that file to specify them as exportable.

From libtool (the script itself), when using xlC (gcc flags are different! although this is about passing ld flags via the compiler) the variables are defined as:

+362 # Commands used to build a shared archive. +363 archive_cmds="" +364 archive_expsym_cmds="\$RM -r \$output_objdir/\$realname.d~\$MKDIR \$output_objdir/\$realname.d~\$CC \$wl-bM:SRE -o \$output_objdir/\$realname.d/\$soname \$libo bjs \$deplibs \$wl-bnoentry `func_echo_all \"\$compiler_flags \" | \$SED -e \"s%-brtl\\([, ]\\)%-berok\\1%g\"`\$wl-bE:\$export_symbols\ $allow_undefined_flag~\$AR \$AR_FLAGS \$output_objdir/\$libname\$release.a \$output_objdir/\$realname.d/\$soname~\$MV
\$output_objdir/\$realname.d/\$soname \$output_o bjdir~\$RM -r \$output_objdir/\$realname.d" +365

And, a GNU project such as gettext expands this to look like: make[5]: Entering directory '/data/prj/gnu/gettext/gettext-0.19.6/gettext-tools/gnulib-lib' /bin/sh ../libtool --tag=CC --mode=link xlc -I/opt/include -I/opt/buildaix/include -O2 -no-undefined ../intl/libintl.la
-lpthread -lpthread -qsmp=omp -release 0.19.6 -lxcurses -o libgettextlib.la -rpath /opt/lib copy-acl.lo set-acl.lo acl-errno-valid.lo acl-internal.lo get-permissions.lo set-permissions.lo allocator.lo areadlink.lo argmatch.lo gl_array_list.lo backupfile.lo addext.lo basename.lo binary-io.lo c-ctype.lo c-strcasecmp.lo c-strncasecmp.lo c-strcasestr.lo c-strstr.lo careadlinkat.lo classpath.lo clean-temp.lo cloexec.lo closeout.lo concat-filename.lo copy-file.lo csharpcomp.lo csharpexec.lo error-progname.lo execute.lo exitfail.lo fatal-signal.lo fd-hook.lo fd-ostream.lo fd-safer-flag.lo dup-safer-flag.lo file-ostream.lo findprog.lo fstrcmp.lo full-write.lo fwriteerror.lo gcd.lo hash.lo html-ostream.lo html-styled-ostream.lo
javacomp.lo javaexec.lo javaversion.lo gl_linkedhash_list.lo gl_list.lo localcharset.lo localename.lo glthread/lock.lo malloca.lo mbchar.lo mbiter.lo mbslen.lo mbsstr.lo mbswidth.lo mbuiter.lo ostream.lo pipe-filter-ii.lo pipe-filter-aux.lo pipe2.lo pipe2-safer.lo progname.lo propername.lo qcopy-acl.lo qset-acl.lo quotearg.lo safe-read.lo safe-write.lo sh-quote.lo sig-handler.lo spawn-pipe.lo striconv.lo striconveh.lo striconveha.lo strnlen1.lo styled-ostream.lo tempname.lo term-ostream.lo term-styled-ostream.lo glthread/threadlib.lo glthread/tls.lo tmpdir.lo trim.lo uniconv/u8-conv-from-enc.lo unictype/ctype_space.lo unilbrk/lbrktables.lo unilbrk/u8-possible-linebreaks.lo unilbrk/u8-width-linebreaks.lo unilbrk/ulc-common.lo unilbrk/ulc-width-linebreaks.lo uniname/uniname.lo unistd.lo dup-safer.lo fd-safer.lo pipe-safer.lo unistr/u16-mbtouc.lo unistr/u16-mbtouc-aux.lo unistr/u8-check.lo unistr/u8-mblen.lo unistr/u8-mbtouc.lo unistr/u8-mbtouc-aux.lo unistr/u8-mbtouc-unsafe.lo unistr/u8-mbtouc-unsafe-aux.lo unistr/u8-mbtoucr.lo unistr/u8-prev.lo unistr/u8-uctomb.lo unistr/u8-uctomb-aux.lo uniwidth/width.lo wait-process.lo wctype-h.lo xmalloc.lo xstrdup.lo xconcat-filename.lo xerror.lo gl_xlist.lo xmalloca.lo xreadlink.lo xsetenv.lo xsize.lo xstriconv.lo xstriconveh.lo xvasprintf.lo xasprintf.lo asnprintf.lo asprintf.lo canonicalize-lgpl.lo dup2.lo error.lo fcntl.lo float.lo fopen.lo getdelim.lo getline.lo getopt.lo getopt1.lo iconv_open.lo lstat.lo mbrtowc.lo mbsinit.lo mbsrtowcs.lo mbsrtowcs-state.lo mkdtemp.lo obstack.lo open.lo printf-args.lo printf-parse.lo rawmemchr.lo secure_getenv.lo spawn_faction_addclose.lo spawn_faction_adddup2.lo spawn_faction_addopen.lo spawn_faction_destroy.lo spawn_faction_init.lo spawnattr_destroy.lo spawnattr_init.lo spawnattr_setflags.lo spawnattr_setsigmask.lo spawni.lo spawnp.lo stat.lo stpncpy.lo strchrnul.lo strerror.lo strerror-override.lo strstr.lo vasnprintf.lo vasprintf.lo libcroco_rpl.la libglib_rpl.la libxml_rpl.la libtool: link: rm -fr .libs/libgettextlib-0.19.6.a.d .libs/libgettextlib.exp libtool: link: func_echo_all /usr/bin/nm -B | /usr/bin/sed -e 's/B\([^B]*\)$/P\1/' -PCpgl .libs/copy-acl.o .libs/set-acl.o .libs/acl-errno-valid.o .libs/acl-internal.o .libs/get-permissions.o .libs/set-permissions.o .libs/allocator.o .libs/areadlink.o .libs/argmatch.o .libs/gl_array_list.o .libs/backupfile.o .libs/addext.o .libs/basename.o .libs/binary-io.o .libs/c-ctype.o .libs/c-strcasecmp.o .libs/c-strncasecmp.o .libs/c-strcasestr.o .libs/c-strstr.o .libs/careadlinkat.o .libs/classpath.o .libs/clean-temp.o .libs/cloexec.o .libs/closeout.o .libs/concat-filename.o .libs/copy-file.o .libs/csharpcomp.o .libs/csharpexec.o .libs/error-progname.o .libs/execute.o .libs/exitfail.o .libs/fatal-signal.o .libs/fd-hook.o .libs/fd-ostream.o .libs/fd-safer-flag.o .libs/dup-safer-flag.o .libs/file-ostream.o .libs/findprog.o .libs/fstrcmp.o .libs/full-write.o .libs/fwriteerror.o .libs/gcd.o .libs/hash.o .libs/html-ostream.o .libs/html-styled-ostream.o .libs/javacomp.o .libs/javaexec.o .libs/javaversion.o .libs/gl_linkedhash_list.o .libs/gl_list.o .libs/localcharset.o .libs/localename.o glthread/.libs/lock.o .libs/malloca.o .libs/mbchar.o .libs/mbiter.o .libs/mbslen.o .libs/mbsstr.o .libs/mbswidth.o .libs/mbuiter.o .libs/ostream.o .libs/pipe-filter-ii.o .libs/pipe-filter-aux.o .libs/pipe2.o .libs/pipe2-safer.o .libs/progname.o .libs/propername.o .libs/qcopy-acl.o .libs/qset-acl.o .libs/quotearg.o .libs/safe-read.o .libs/safe-write.o .libs/sh-quote.o .libs/sig-handler.o .libs/spawn-pipe.o .libs/striconv.o .libs/striconveh.o .libs/striconveha.o .libs/strnlen1.o .libs/styled-ostream.o .libs/tempname.o .libs/term-ostream.o .libs/term-styled-ostream.o glthread/.libs/threadlib.o glthread/.libs/tls.o .libs/tmpdir.o .libs/trim.o uniconv/.libs/u8-conv-from-enc.o unictype/.libs/ctype_space.o unilbrk/.libs/lbrktables.o unilbrk/.libs/u8-possible-linebreaks.o unilbrk/.libs/u8-width-linebreaks.o unilbrk/.libs/ulc-common.o unilbrk/.libs/ulc-width-linebreaks.o uniname/.libs/uniname.o .libs/unistd.o .libs/dup-safer.o .libs/fd-safer.o .libs/pipe-safer.o unistr/.libs/u16-mbtouc.o unistr/.libs/u16-mbtouc-aux.o unistr/.libs/u8-check.o unistr/.libs/u8-mblen.o unistr/.libs/u8-mbtouc.o unistr/.libs/u8-mbtouc-aux.o unistr/.libs/u8-mbtouc-unsafe.o unistr/.libs/u8-mbtouc-unsafe-aux.o unistr/.libs/u8-mbtoucr.o unistr/.libs/u8-prev.o unistr/.libs/u8-uctomb.o unistr/.libs/u8-uctomb-aux.o uniwidth/.libs/width.o .libs/wait-process.o .libs/wctype-h.o .libs/xmalloc.o .libs/xstrdup.o .libs/xconcat-filename.o .libs/xerror.o .libs/gl_xlist.o .libs/xmalloca.o .libs/xreadlink.o .libs/xsetenv.o .libs/xsize.o .libs/xstriconv.o .libs/xstriconveh.o .libs/xvasprintf.o .libs/xasprintf.o .libs/asnprintf.o .libs/asprintf.o .libs/canonicalize-lgpl.o .libs/dup2.o .libs/error.o .libs/fcntl.o .libs/float.o .libs/fopen.o .libs/getdelim.o .libs/getline.o .libs/getopt.o .libs/getopt1.o .libs/iconv_open.o .libs/lstat.o .libs/mbrtowc.o .libs/mbsinit.o .libs/mbsrtowcs.o .libs/mbsrtowcs-state.o .libs/mkdtemp.o .libs/obstack.o .libs/open.o .libs/printf-args.o .libs/printf-parse.o .libs/rawmemchr.o .libs/secure_getenv.o .libs/spawn_faction_addclose.o .libs/spawn_faction_adddup2.o .libs/spawn_faction_addopen.o .libs/spawn_faction_destroy.o .libs/spawn_faction_init.o .libs/spawnattr_destroy.o .libs/spawnattr_init.o .libs/spawnattr_setflags.o .libs/spawnattr_setsigmask.o .libs/spawni.o .libs/spawnp.o .libs/stat.o .libs/stpncpy.o .libs/strchrnul.o .libs/strerror.o .libs/strerror-override.o .libs/strstr.o .libs/vasnprintf.o .libs/vasprintf.o ./.libs/libcroco_rpl.a ./.libs/libglib_rpl.a ./.libs/libxml_rpl.a | awk '{ if ((($ 2 == "T") || ($ 2 == "D") || ($ 2 == "B") || ($ 2 == "W") || ($ 2 == "V") || ($ 2 == "Z")) && (substr($ 1,1,1) != ".")) { if (($ 2 == "W") || ($ 2 == "V") || ($ 2 == "Z")) { print $ 1 " weak" } else { print $ 1 } } }' | sort -u > .libs/libgettextlib.exp libtool: link: rm -f -r .libs/libgettextlib-0.19.6.a.d libtool: link: mkdir .libs/libgettextlib-0.19.6.a.d libtool: link: xlc -Wl,-bM:SRE -o .libs/libgettextlib-0.19.6.a.d/libgettextlib-0.19.6.so .libs/copy-acl.o .libs/set-acl.o .libs/acl-errno-valid.o .libs/acl-internal.o .libs/get-permissions.o .libs/set-permissions.o .libs/allocator.o .libs/areadlink.o .libs/argmatch.o .libs/gl_array_list.o .libs/backupfile.o .libs/addext.o .libs/basename.o .libs/binary-io.o .libs/c-ctype.o .libs/c-strcasecmp.o .libs/c-strncasecmp.o .libs/c-strcasestr.o .libs/c-strstr.o .libs/careadlinkat.o .libs/classpath.o .libs/clean-temp.o .libs/cloexec.o .libs/closeout.o .libs/concat-filename.o .libs/copy-file.o .libs/csharpcomp.o .libs/csharpexec.o .libs/error-progname.o .libs/execute.o .libs/exitfail.o .libs/fatal-signal.o .libs/fd-hook.o .libs/fd-ostream.o .libs/fd-safer-flag.o .libs/dup-safer-flag.o .libs/file-ostream.o .libs/findprog.o .libs/fstrcmp.o .libs/full-write.o .libs/fwriteerror.o .libs/gcd.o .libs/hash.o .libs/html-ostream.o .libs/html-styled-ostream.o .libs/javacomp.o .libs/javaexec.o .libs/javaversion.o .libs/gl_linkedhash_list.o .libs/gl_list.o .libs/localcharset.o .libs/localename.o glthread/.libs/lock.o .libs/malloca.o .libs/mbchar.o .libs/mbiter.o .libs/mbslen.o .libs/mbsstr.o .libs/mbswidth.o .libs/mbuiter.o .libs/ostream.o .libs/pipe-filter-ii.o .libs/pipe-filter-aux.o .libs/pipe2.o .libs/pipe2-safer.o .libs/progname.o .libs/propername.o .libs/qcopy-acl.o .libs/qset-acl.o .libs/quotearg.o .libs/safe-read.o .libs/safe-write.o .libs/sh-quote.o .libs/sig-handler.o .libs/spawn-pipe.o .libs/striconv.o .libs/striconveh.o .libs/striconveha.o .libs/strnlen1.o .libs/styled-ostream.o .libs/tempname.o .libs/term-ostream.o .libs/term-styled-ostream.o glthread/.libs/threadlib.o glthread/.libs/tls.o .libs/tmpdir.o .libs/trim.o uniconv/.libs/u8-conv-from-enc.o unictype/.libs/ctype_space.o unilbrk/.libs/lbrktables.o unilbrk/.libs/u8-possible-linebreaks.o unilbrk/.libs/u8-width-linebreaks.o unilbrk/.libs/ulc-common.o unilbrk/.libs/ulc-width-linebreaks.o uniname/.libs/uniname.o .libs/unistd.o .libs/dup-safer.o .libs/fd-safer.o .libs/pipe-safer.o unistr/.libs/u16-mbtouc.o unistr/.libs/u16-mbtouc-aux.o unistr/.libs/u8-check.o unistr/.libs/u8-mblen.o unistr/.libs/u8-mbtouc.o unistr/.libs/u8-mbtouc-aux.o unistr/.libs/u8-mbtouc-unsafe.o unistr/.libs/u8-mbtouc-unsafe-aux.o unistr/.libs/u8-mbtoucr.o unistr/.libs/u8-prev.o unistr/.libs/u8-uctomb.o unistr/.libs/u8-uctomb-aux.o uniwidth/.libs/width.o .libs/wait-process.o .libs/wctype-h.o .libs/xmalloc.o .libs/xstrdup.o .libs/xconcat-filename.o .libs/xerror.o .libs/gl_xlist.o .libs/xmalloca.o .libs/xreadlink.o .libs/xsetenv.o .libs/xsize.o .libs/xstriconv.o .libs/xstriconveh.o .libs/xvasprintf.o .libs/xasprintf.o .libs/asnprintf.o .libs/asprintf.o .libs/canonicalize-lgpl.o .libs/dup2.o .libs/error.o .libs/fcntl.o .libs/float.o .libs/fopen.o .libs/getdelim.o .libs/getline.o .libs/getopt.o .libs/getopt1.o .libs/iconv_open.o .libs/lstat.o .libs/mbrtowc.o .libs/mbsinit.o .libs/mbsrtowcs.o .libs/mbsrtowcs-state.o .libs/mkdtemp.o .libs/obstack.o .libs/open.o .libs/printf-args.o .libs/printf-parse.o .libs/rawmemchr.o .libs/secure_getenv.o .libs/spawn_faction_addclose.o .libs/spawn_faction_adddup2.o .libs/spawn_faction_addopen.o .libs/spawn_faction_destroy.o .libs/spawn_faction_init.o .libs/spawnattr_destroy.o .libs/spawnattr_init.o .libs/spawnattr_setflags.o .libs/spawnattr_setsigmask.o .libs/spawni.o .libs/spawnp.o .libs/stat.o .libs/stpncpy.o .libs/strchrnul.o .libs/strerror.o .libs/strerror-override.o .libs/strstr.o .libs/vasnprintf.o .libs/vasprintf.o ./.libs/libcroco_rpl.a ./.libs/libglib_rpl.a ./.libs/libxml_rpl.a
-Wl,-blibpath:/data/prj/gnu/gettext/gettext-0.19.6/gettext-tools/intl/.libs:/opt/lib:/usr/vac/lib:/usr/lib:/lib -L../intl/.libs -lintl -lc -lpthread -lxcurses -lc -Wl,-bnoentry func_echo_all " -O2 -qsmp=omp -qsmp=omp " | /usr/bin/sed -e "s%-brtl\\([, ]\\)%-berok\\1%g"-Wl,-bE:.libs/libgettextlib.exp -Wl,-bernotok

After reading the 'man ld' page carefully, I am hoping that the -G flag might be a much easier way to do this. The key flag that libtool is using above is -bM:SRE - excerpts follow.

To break down the last command into the key parts (i.e., delete the noise of all the .o files) the command looks like:

libtool: link: xlc -Wl,-bM:SRE -o .libs/libgettextlib-0.19.6.a.d/libgettextlib-0.19.6.so .libs/copy-acl.o ... .libs/vasprintf.o ... ./.libs/libxmlrpl.a
-Wl,-blibpath:/data/prj/gnu/gettext/gettext-0.19.6/gettext-tools/intl/.libs:/opt/lib:/usr/vac/lib:/usr/lib:/lib -L../intl/.libs -lintl -lc -lpthread -lxcurses -lc
-Wl,-bnoentry ... -Wl,-bE:.libs/libgettextlib.exp -Wl,-bernotok_

The flag -G for ld does:

    -G
         Produces a shared object enabled for use with the run-time 

linker. The -G flag is equivalent to specifying the erok, rtl, nortllib, nosymbolic, noautoexp, and M:SRE options with the -b flag. Subsequent options can override these options.

So, what do these options do?

-b M:ModuleType or modtype:ModuleType Sets the two-character module-type field and the shared object flag in the object file. The module type is not checked by the binder, but it should be set to one of the following values: ...

One comment I find interesting, yet unable to compare right now with past comments about AIX not exporting is the default of autoexp. Application binding is not (yet) a specialty of mine,

vinhdizzo commented 9 years ago

Hmm, can't tell if you posted a solution. Could you clarify?

Also, I noticed that you posted on R-devel for building R. Not sure if you're having issues, but here are my notes on building R. Hope this helps. Thanks!

vinhdizzo commented 9 years ago

@aixtools Any updates? Could you clarify on your latest findings? Thanks.

aixtools commented 9 years ago

On 2015-10-14 15:07, Vinh Nguyen wrote:

Thanks @aixtools. Please let me know if you need any assistance from me in testing. As I mentioned, once this piece is fixed, it would show me how to install a lot of the R packages. However, there are more errors and I will post them when we know more about this. Is there a preferred channel to post those? Thanks.


Reply to this email directly or view it on GitHub:https://github.com/jyypma/nloptr/issues/14#issuecomment-148043817

I maintain portal and forums for AIX at http://www.rootvg.net, and http://forums.rootvg.net. Specifically for tools I have a forum at http://forums.rootvg.net/aixtools/ (and since I am sinning by 'promoting' my URL's I also package open-source tools for AIX - with a wiki-like documentation at http://www.aixtools.net.

THIS HAS BEEN STUCK IN draft (sorry for the caps) for 9 days.

My apologies.

aixtools commented 9 years ago

As I just posted, my last reply was stuck in DRAFTS. It was not my intent to look as if I am not doing anything.

I have posted a few comments to the R-devel mailing list and from the replies I received I see I need to study the idiosyncrasies of 64/bit builds. To that end, I am working on my buildaix scripts to automate 64/bit builds.

I have just completed building gnu/gettext as a 64-bit version with a single command - so things are looking better - from my perspective.

Again getting back to the responses I received on R-devel I feel that a ground-up approach is needed to fix current and prevent future problems. One of the recommendations, e.g., is to add "power6" - while that is just one machine. With AIX 7.2, e.g., power6 is no longer supported - only power7 and power8.

So, short term - I shall be working on hacks to get a good 64-bit build completed while I study what should be in place in the GNU autotools to simplify building R-devel and libraries/additions for R.

Thank you for your patience!

Michael

On Tue, Oct 20, 2015 at 11:37 PM, Vinh Nguyen notifications@github.com wrote:

@aixtools https://github.com/aixtools Any updates? Could you clarify on your latest findings? Thanks.

— Reply to this email directly or view it on GitHub https://github.com/jyypma/nloptr/issues/14#issuecomment-149710803.