Thanks for the reply. -Wl,--export-dynamic was already defined. After a lot of back and forth if i removed -Wl,--no-whole-archive /nfs/punlinuxvault1/fcdata5/data9/schadha/julia-0.4.6/usr/lib/libunwind-generic.a /nfs/punlinuxvault1/fcdata5/data9/schadha/julia-0.4.6/usr/lib/libunwind.a and added -Wl,-E it worked. Cant figure out what i was doing wrong though and why the default settings dont work.
Anyway thank you for helping me with this. On Saturday, 16 July 2016 19:37:44 UTC+5:30, Tony Kelman wrote: > > See also https://github.com/JuliaLang/julia/issues/17451, > -Wl,--export-dynamic might help (thanks to Yichao Yu for that one). > > > On Sunday, July 10, 2016 at 11:38:11 PM UTC-7, Sourabh Chadha wrote: >> >> Thanks for the reply. After changing the compiler flags etc. the symbols >> now seem to be exported but i get the same error. Here is the nm output >> >> nm ../usr/bin/embedding | grep my >> 0000000000601da0 t __frame_dummy_init_array_entry >> 0000000000400f10 t frame_dummy >> 0000000000400f40 T my_c_sqrt >> >> >> On Saturday, 9 July 2016 17:38:23 UTC+5:30, Isaiah wrote: >>> >>> The symbol exists but is not exported (t vs T). Try adding DLLEXPORT in >>> front of the function declaration. On 0.4 it appears to have had a >>> Windows-only export declaration. >>> >>> On Saturday, July 9, 2016, Sourabh Chadha <sourabh...@gmail.com> wrote: >>> >>>> I am new to Julia and have been trying to use ccall to call C functions >>>> in embedded mode but i am unable to even successfully run the example >>>> embedding.c that is in package. The example file define a >>>> function my_c_sqrt and then tries to call it using >>>> jl_eval_string("println( >>>> ccall( :my_c_sqrt, Float64, (Float64,), 2.0 ) )");. This doesnt work and >>>> if >>>> i trace the issue by printing errors i get ErrorException("ccall: could >>>> not >>>> find function my_c_sqrt"). >>>> >>>> I have tried checking eveything. nm on the executble gives this. >>>> nm ../usr/bin/embedding | grep my >>>> 0000000000601d80 t __frame_dummy_init_array_entry >>>> 0000000000400f60 t frame_dummy >>>> 0000000000400f90 t my_c_sqrt >>>> >>>> so the symbol is available. >>>> >>>> I am running Red Hat Enterprise Linux Workstation release 7.0 (Maipo) >>>> nd hve compiled julia Version 0.4.6 from scratch. >>>> >>>> any help would be really appreciated >>>> >>>>