Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I want to configure my new PostgreSQL Server without ldap. When I execute "gmake world" command it turns out the follwoing error; anybody knows this?
If have tested that if I configure PostgreSQL --with-ldap, it is okay!
--version
PostgreSQL: Postgresql 9.1
OS : Red Hat Enterprise Linux Server release 5.5 (Tikanga)
--config script
./configure --prefix=/opt/pgsql9.1 --with-pgport=1923 --with-segsize=8 --with-wal-segsize=64 --with-wal-blocksize=64 --with-perl --with-python --with-openssl --with-pam --with-libxml --with-libxslt --enable-thread-safety --without-ldap
--a part of "gmake world" log
utils/time/tqual.o utils/time/snapmgr.o utils/fmgrtab.o ../../src/timezone/localtime.o ../../src/timezone/strftime.o ../../src/timezone/pgtz.o ../../src/port/libpgport_srv.a -lxslt -lxml2 -lpam -lssl -lcrypto -lcrypt -ldl -lm -o postgres
libpq/auth.o: In function `InitializeLDAPConnection':
auth.c:(.text+0x2c4): undefined reference to `ldap_init'
auth.c:(.text+0x2e7): undefined reference to `ldap_set_option'
auth.c:(.text+0x329): undefined reference to `ldap_start_tls_s'
auth.c:(.text+0x339): undefined reference to `ldap_unbind'
auth.c:(.text+0x37e): undefined reference to `ldap_unbind'
libpq/auth.o: In function `CheckLDAPAuth':
auth.c:(.text+0x163a): undefined reference to `ldap_simple_bind_s'
auth.c:(.text+0x1647): undefined reference to `ldap_unbind'
auth.c:(.text+0x1690): undefined reference to `ldap_simple_bind_s'
auth.c:(.text+0x174c): undefined reference to `ldap_search_s'
auth.c:(.text+0x1768): undefined reference to `ldap_count_entries'
auth.c:(.text+0x1783): undefined reference to `ldap_first_entry'
auth.c:(.text+0x1792): undefined reference to `ldap_get_dn'
auth.c:(.text+0x17c3): undefined reference to `ldap_memfree'
auth.c:(.text+0x17ce): undefined reference to `ldap_msgfree'
auth.c:(.text+0x17d9): undefined reference to `ldap_unbind_s'
auth.c:(.text+0x1929): undefined reference to `ldap_get_option'
auth.c:(.text+0x1964): undefined reference to `ldap_err2string'
auth.c:(.text+0x19c2): undefined reference to `ldap_get_option'
auth.c:(.text+0x19fd): undefined reference to `ldap_err2string'
auth.c:(.text+0x1a42): undefined reference to `ldap_msgfree'
auth.c:(.text+0x1a5e): undefined reference to `ldap_count_entries'
auth.c:(.text+0x1b0a): undefined reference to `ldap_count_entries'
collect2: ld 返回 1
gmake[2]: *** [postgres] 错误 1
gmake[2]: Leaving directory `/opt/soft_bak/postgresql-9.1.0/src/backend'
gmake[1]: *** [all-backend-recurse] 错误 2
gmake[1]: Leaving directory `/opt/soft_bak/postgresql-9.1.0/src'
gmake: *** [world-src-recurse] 错误 2
If you first build --with-ldap and then without, you need to run make distclean in between (or do configure --enable-depend in the first run).
Related
I am trying to build the axidma-benchmark application with the Xilinx-axidma driver (Github repo) provided by bperez77.
I am using Petalinux 20.2 to build Linux for my custom project.
In the new version of the kernel, some functions are changed and I get some errors when running petalinux-build. I changed the driver files as mentioned here and build the kernel module successfully.
In the following, I create the custom application by running:
petalinux-create -t apps --name axidma-benchmark --enable
Then I copy the application files into the recipes-apps directory and append all C and header files to the SRC_URI List in the axidma-benchmark.bb as:
SRC_URI = "file://axidma-benchmark.c \
file://axidma_ioctl.h \
file://conversion.h \
file://libaxidma.h \
file://util.c \
file://util.h \
file://Makefile \
"
Then I add APP_OBJS += util.o to the Makefile and build the application by running:
petalinux-build -c axidma-benchmark
But I got these errors:
ERROR: axidma-benchmark-1.0-r0 do_compile: oe_runmake failed
ERROR: axidma-benchmark-1.0-r0 do_compile: Execution of '/media/fpgaws/projects/DevelopmentLab/build/apu/ultrazed7ev/build/tmp/work/aarch64-xilinx-linux/axidma-benchmark/1.0-r0/temp/run.do_compile.21635' failed with exit code 1:
aarch64-xilinx-linux-gcc -march=armv8-a+crc -mtune=cortex-a72.cortex-a53 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/media/fpgaws/projects/DevelopmentLab/build/apu/ultrazed7ev/build/tmp/work/aarch64-xilinx-linux/axidma-benchmark/1.0-r0/recipe-sysroot -o axidma-benchmark axidma-benchmark.o util.o -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now
/media/fpgaws/projects/DevelopmentLab/build/apu/ultrazed7ev/build/tmp/work/aarch64-xilinx-linux/axidma-benchmark/1.0-r0/recipe-sysroot-native/usr/bin/aarch64-xilinx-linux/../../libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/ld: axidma-benchmark.o: in function main': /usr/src/debug/axidma-benchmark/1.0-r0/axidma-benchmark.c:491: undefined reference to axidma_init'
/media/fpgaws/projects/DevelopmentLab/build/apu/ultrazed7ev/build/tmp/work/aarch64-xilinx-linux/axidma-benchmark/1.0-r0/recipe-sysroot-native/usr/bin/aarch64-xilinx-linux/../../libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/ld: /usr/src/debug/axidma-benchmark/1.0-r0/axidma-benchmark.c:499: undefined reference to axidma_malloc' /media/fpgaws/projects/DevelopmentLab/build/apu/ultrazed7ev/build/tmp/work/aarch64-xilinx-linux/axidma-benchmark/1.0-r0/recipe-sysroot-native/usr/bin/aarch64-xilinx-linux/../../libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/ld: /usr/src/debug/axidma-benchmark/1.0-r0/axidma-benchmark.c:505: undefined reference to axidma_malloc'
/media/fpgaws/projects/DevelopmentLab/build/apu/ultrazed7ev/build/tmp/work/aarch64-xilinx-linux/axidma-benchmark/1.0-r0/recipe-sysroot-native/usr/bin/aarch64-xilinx-linux/../../libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/ld: /usr/src/debug/axidma-benchmark/1.0-r0/axidma-benchmark.c:514: undefined reference to axidma_get_vdma_tx' /media/fpgaws/projects/DevelopmentLab/build/apu/ultrazed7ev/build/tmp/work/aarch64-xilinx-linux/axidma-benchmark/1.0-r0/recipe-sysroot-native/usr/bin/aarch64-xilinx-linux/../../libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/ld: /usr/src/debug/axidma-benchmark/1.0-r0/axidma-benchmark.c:515: undefined reference to axidma_get_vdma_rx'
/media/fpgaws/projects/DevelopmentLab/build/apu/ultrazed7ev/build/tmp/work/aarch64-xilinx-linux/axidma-benchmark/1.0-r0/recipe-sysroot-native/usr/bin/aarch64-xilinx-linux/../../libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/ld: axidma-benchmark.o: in function single_transfer_test': /usr/src/debug/axidma-benchmark/1.0-r0/axidma-benchmark.c:396: undefined reference to axidma_twoway_transfer'
/media/fpgaws/projects/DevelopmentLab/build/apu/ultrazed7ev/build/tmp/work/aarch64-xilinx-linux/axidma-benchmark/1.0-r0/recipe-sysroot-native/usr/bin/aarch64-xilinx-linux/../../libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/ld: axidma-benchmark.o: in function main': /usr/src/debug/axidma-benchmark/1.0-r0/axidma-benchmark.c:558: undefined reference to axidma_free'
/media/fpgaws/projects/DevelopmentLab/build/apu/ultrazed7ev/build/tmp/work/aarch64-xilinx-linux/axidma-benchmark/1.0-r0/recipe-sysroot-native/usr/bin/aarch64-xilinx-linux/../../libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/ld: /usr/src/debug/axidma-benchmark/1.0-r0/axidma-benchmark.c:560: undefined reference to axidma_free' /media/fpgaws/projects/DevelopmentLab/build/apu/ultrazed7ev/build/tmp/work/aarch64-xilinx-linux/axidma-benchmark/1.0-r0/recipe-sysroot-native/usr/bin/aarch64-xilinx-linux/../../libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/ld: /usr/src/debug/axidma-benchmark/1.0-r0/axidma-benchmark.c:562: undefined reference to axidma_destroy'
/media/fpgaws/projects/DevelopmentLab/build/apu/ultrazed7ev/build/tmp/work/aarch64-xilinx-linux/axidma-benchmark/1.0-r0/recipe-sysroot-native/usr/bin/aarch64-xilinx-linux/../../libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/ld: /usr/src/debug/axidma-benchmark/1.0-r0/axidma-benchmark.c:519: undefined reference to axidma_get_dma_tx' /media/fpgaws/projects/DevelopmentLab/build/apu/ultrazed7ev/build/tmp/work/aarch64-xilinx-linux/axidma-benchmark/1.0-r0/recipe-sysroot-native/usr/bin/aarch64-xilinx-linux/../../libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/ld: /usr/src/debug/axidma-benchmark/1.0-r0/axidma-benchmark.c:520: undefined reference to axidma_get_dma_rx'
/media/fpgaws/projects/DevelopmentLab/build/apu/ultrazed7ev/build/tmp/work/aarch64-xilinx-linux/axidma-benchmark/1.0-r0/recipe-sysroot-native/usr/bin/aarch64-xilinx-linux/../../libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/ld: axidma-benchmark.o: in function time_dma': /usr/src/debug/axidma-benchmark/1.0-r0/axidma-benchmark.c:426: undefined reference to axidma_twoway_transfer'
collect2: error: ld returned 1 exit status
make: *** [Makefile:12: axidma-benchmark] Error 1
WARNING: /media/fpgaws/projects/DevelopmentLab/build/apu/ultrazed7ev/build/tmp/work/aarch64-xilinx-linux/axidma-benchmark/1.0-r0/temp/run.do_compile.21635:1 exit 1 from 'exit 1'
ERROR: Logfile of failure stored in: /media/fpgaws/projects/DevelopmentLab/build/apu/ultrazed7ev/build/tmp/work/aarch64-xilinx-linux/axidma-benchmark/1.0-r0/temp/log.do_compile.21635
What is my mistake?
I have forgotten to add the libaxidma.c files into the file directory. By adding this file application was built successfully.
Update:
You can access the final version of my code via this link.
If you have any problems, please let me know.
Currently I am trying to run my Simulink model, built with Matlab 2019b, on a server of my university, which runs on Linux CentOS 7.3.1611. If I run the model in either 'normal', or 'accelerator' mode it is successful. However, if I try to run the model in 'rapid accelerator mode' the compiler returns an error during building. The errors all contain the element of not finding the standard library:
undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>
I have searched on MATLAB Answers and stackoverflow for solutions, but none have worked for me so far. I have also asked the IT service of my university for help but they could not help me out.
One of the solutions hinted towards the compiler not being able to find the correct libraries and that the library path should be added/updated here on stack overflow. However, if I print the Library path in matlab then it seems allright:
Library path:
<matlab_root>/cefclient/sys/os/glnxa64:<matlab_root>/sys/opengl/lib/glnxa64:<matlab_root>/sys/os/glnxa64:<matlab_root>/bin/glnxa64:<matlab_root>/extern/lib/glnxa64:<matlab_root>/runtime/glnxa64:<matlab_root>/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:
<matlab_root>/sys/java/jre/glnxa64/jre/lib/amd64/server:<compiler_root>/root/usr/lib64:<compiler_root>/root/usr/lib:<compiler_root>/root/usr/lib64/dyninst
Another problem could be the compiler. At first I used a gcc 8.x compiler, but later found out that a 6.3 version is required, so that is what I am using now
Lastly I found a that a problem could be that "(...) it probably indicates that you are trying to link together object files that were compiled with different values for the _GLIBCXX_USE_CXX11_ABI macro." (from stack overflow)
The last option seems the most likely to me, however, I have not been able to solve this. I tried for instance:
set_param(model,'AccelMakeCommand','make_rtw CPP_OPTS="-D_GLIBCXX_USE_CXX11_ABI=0"')
and
set_param(model,'MakeCommand','make_rtw CPP_OPTS="-D_GLIBCXX_USE_CXX11_ABI=0"')
However, this did not help.
If anyone has a tip that could help me out, that would be great. I have added parts of the console output and the error message were it goes wrong down below for extra info.
Kind regards,
Nathan
Console output messages:
( A lot of other stuff)
### Processing Template Makefile: <matlab_root>/rtw/c/raccel/raccel_unix.tmf
### <model_folder>/slprj/raccel/MyModel/MyModel.mk which is generated from <matlab_root>/rtw/c/raccel/raccel_unix.tmf is up to date
### Building MyModel: <matlab_root>/bin/glnxa64/gmake -f MyModel.mk RSIM_SOLVER_SELECTION=2 PCMATLABROOT="<matlab_root>" EXTMODE_STATIC_ALLOC=0 EXTMODE_STATIC_ALLOC_SIZE=1000000 EXTMODE_TRANSPORT=0 TMW_EXTMODE_TESTING=0 COMBINE_OUTPUT_UPDATE_FCNS=0 INCLUDE_MDL_TERMINATE_FCN=1 MULTI_INSTANCE_CODE=0 MODELREF_TARGET_TYPE=NONE ISPROTECTINGMODEL=NOTPROTECTING OPTS="-DTGT
an error.
Error message:
( A lot of stuff)
g++ -Wl,-rpath,<matlab_root>/sys/os/glnxa64
-L<matlab_root>/sys/os/glnxa64 -o MyModel
MyModel_c233cdf9_1.o MyModel_c233cdf9_1_create.o
MyModel_c233cdf9_1_setParameters.o
MyModel_c233cdf9_1_asserts.o
MyModel_c233cdf9_1_deriv.o
MyModel_c233cdf9_1_checkDynamics.o
MyModel_c233cdf9_1_output.o
MyModel_c233cdf9_1_assembly.o
MyModel_c233cdf9_1_computeConstraintError.o
MyModel_c233cdf9_1_mode_zero_crossings.o
MyModel_c233cdf9_1_geometries.o
MyModel_c233cdf9_1_gateway.o pm_printf.o rt_logging.o
rt_backsubrr_dbl.o rt_forwardsubrr_dbl.o rt_lu_real.o rt_matrixlib_dbl.o
MyModel.o MyModel_capi.o
MyModel_data.o MyModel_tgtconn.o rtGetInf.o
rtGetNaN.o rt_nonfinite.o rt_logging_mmi.o rtw_modelmap_utils.o
raccel_main_new.o raccel_sup.o raccel_mat.o simulink_solver_api.o
raccel_utils.o common_utils.o ext_svr.o updown.o ext_work.o
rtiostream_interface.o rtiostream_tcpip.o rtiostream_utils.o \
<matlab_root>/toolbox/physmod/sm/ssci/lib/glnxa64/sm_ssci_std.a
<matlab_root>/toolbox/physmod/sm/core/lib/glnxa64/sm_std.a
<matlab_root>/toolbox/physmod/pm_math/lib/glnxa64/pm_math_std.a
<matlab_root>/toolbox/physmod/simscape/engine/sli/lib/glnxa64/ssc_sli_std.a
<matlab_root>/toolbox/physmod/simscape/engine/core/lib/glnxa64/ssc_core_std.a
<matlab_root>/toolbox/physmod/network_engine/lib/glnxa64/ne_std.a
<matlab_root>/toolbox/physmod/common/math/core/lib/glnxa64/mc_std.a
<matlab_root>/toolbox/physmod/common/external/library/lib/glnxa64/ex_std.a
<matlab_root>/toolbox/physmod/common/foundation/core/lib/glnxa64/pm_std.a
<matlab_root>/bin/glnxa64/libmwcoder_target_services.so
<matlab_root>/bin/glnxa64/libmwcoder_ParamTuningTgtAppSvc.so
-L"<matlab_root>/bin/glnxa64" -lmwipp -lut -lmx -lmex
-lmat -lmwmathutil -lmwslexec_simbridge -lmwsl_fileio
-lmwsigstream -lmwsl_AsyncioQueue -lmwsl_services
-lmwsdi_raccel -lmwi18n -lmwsl_simtarget_instrumentation
-lfixedpoint -lmwslexec_simlog -lm -lpthread -ldl
<matlab_root>/bin/glnxa64/libQt5WebKit.so.5: undefined reference to
`std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >::_S_copy(char*, char const*, unsigned
long)#GLIBCXX_3.4.21'
<matlab_root>/bin/glnxa64/libmwboost_locale.so.1.65.1: undefined
reference to `std::__cxx11::numpunct<char>::id#GLIBCXX_3.4.21'
<matlab_root>/bin/glnxa64/libmwboost_serialization.so.1.65.1:
undefined reference to `typeinfo for
std::__codecvt_utf8_base<wchar_t>#GLIBCXX_3.4.21'
<matlab_root>/bin/glnxa64/libut.so: undefined reference to
`std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >::assign(char const*)#GLIBCXX_3.4.21'
<matlab_root>/bin/glnxa64/libut.so: undefined reference to
`std::logic_error::logic_error(char const*)#GLIBCXX_3.4.21'
<matlab_root>/bin/glnxa64/libmwcoder_target_services.so: undefined
reference to `typeinfo for std::_V2::error_category#GLIBCXX_3.4.21'
<matlab_root>/bin/glnxa64/libmwboost_locale.so.1.65.1: undefined
reference to `typeinfo for std::__cxx11::moneypunct_byname<char,
false>#GLIBCXX_3.4.21'
( A lot of stuff)
collect2: error: ld returned 1 exit status
gmake: *** [MyModel] Error 1
Error(s) encountered while building "MyModel" - Show complete
stack trace
}
While executing make command, I recieve the following error:
/home/cse/phd/16071009/NLP//lib/i686-m64/libmisc.a(File.o): In function File::~File()':
/home/cse/phd/16071009/NLP/misc/src/File.cc:127: undefined reference tolibiconv_close'
/home/cse/phd/16071009/NLP//lib/i686-m64/libmisc.a(File.o): In function File::reopen(char const*, char const*)':
/home/cse/phd/16071009/NLP/misc/src/File.cc:167: undefined reference tolibiconv_close'
/home/cse/phd/16071009/NLP//lib/i686-m64/libmisc.a(File.o): In function File::reopen(char const*)':
/home/cse/phd/16071009/NLP/misc/src/File.cc:217: undefined reference tolibiconv_close'
/home/cse/phd/16071009/NLP//lib/i686-m64/libmisc.a(File.o): In function File::reopen(char const*, unsigned long, int)':
/home/cse/phd/16071009/NLP/misc/src/File.cc:249: undefined reference tolibiconv_close'
/home/cse/phd/16071009/NLP//lib/i686-m64/libmisc.a(File.o): In function File::reopen(std::string&, int)':
/home/cse/phd/16071009/NLP/misc/src/File.cc:273: undefined reference tolibiconv_close'
/home/cse/phd/16071009/NLP//lib/i686-m64/libmisc.a(File.o): In function File::fgetsUTF8(char*, int)':
/home/cse/phd/16071009/NLP/misc/src/File.cc:387: undefined reference tolibiconv'
/home/cse/phd/16071009/NLP/misc/src/File.cc:345: undefined reference to libiconv_open'
/home/cse/phd/16071009/NLP/misc/src/File.cc:349: undefined reference tolibiconv_open'
collect2: error: ld returned 1 exit status
test -f ../bin/i686-m64/ngram
make[2]: * [../bin/i686-m64/ngram] Error 1
make[2]: Leaving directory /home/cse/phd/16071009/NLP/lm/src'
make[1]: *** [release-programs] Error 1
make[1]: Leaving directory/home/cse/phd/16071009/NLP'
make: * [World] Error 2
[16071009#compute-01 NLP]$
The -liconv appears nowhere in the link command, so that's why you're
getting the undefined references. Try putting:
SYS_LIBRARIES = -L<path-to-libiconv_install> -liconv
For example, if you install srilm on Ubuntu x64, edit this file: common/Makefile.site.i686-m64. Make sure the -L option points to the directory that has the libiconv.so or libiconv.a file.
For me, libiconv install srilm on Ubuntu 18.04 x64 using make are locate on /usr/local/lib. So I add following line to common/Makefile.site.i686-m64:
SYS_LIBRARIES = -L/usr/local/lib -liconv
Solution from: http://mailman.speech.sri.com/pipermail/srilm-user/2014q3/001694.html
I've to install Perl 5.10.1 on Ubuntu 14.04 as per my requirement. When I download and install the package I get the following errors,
cc -fstack-protector -L/usr/local/lib -o miniperl \
gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o xsutils.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o \
miniperlmain.o opmini.o perlmini.o
pp.o: In function `Perl_pp_pow':
pp.c:(.text+0x2daf): undefined reference to `pow'
pp.o: In function `Perl_pp_modulo':
pp.c:(.text+0x39ee): undefined reference to `floor'
pp.c:(.text+0x3a21): undefined reference to `floor'
pp.c:(.text+0x3d94): undefined reference to `fmod'
pp.o: In function `Perl_pp_atan2':
pp.c:(.text+0x8a05): undefined reference to `atan2'
pp.o: In function `Perl_pp_sin':
pp.c:(.text+0x8ba2): undefined reference to `sin'
pp.o: In function `Perl_pp_int':
pp.c:(.text+0x9061): undefined reference to `floor'
pp.c:(.text+0x90d1): undefined reference to `ceil'
pp.o:(.rodata+0x120): undefined reference to `cos'
pp.o:(.rodata+0x128): undefined reference to `sin'
pp.o:(.rodata+0x130): undefined reference to `sin'
pp.o:(.rodata+0x138): undefined reference to `exp'
pp.o:(.rodata+0x140): undefined reference to `log'
pp.o:(.rodata+0x148): undefined reference to `sqrt'
pp_pack.o: In function `S_pack_rec':
pp_pack.c:(.text+0x72b3): undefined reference to `floor'
pp_pack.c:(.text+0x72d6): undefined reference to `floor'
pp_pack.c:(.text+0x7303): undefined reference to `floor'
collect2: error: ld returned 1 exit status
make: *** [miniperl] Error 1
I tried including math library <math.h> in the file pp.c but of no use. Is there anything more I need to do?
Also please tell me whether there is a tool that converts Perl 5.10.1 Script compatible with Perl 5.18.2 as I get backward compatibility warnings when I compile with 5.18.2.
You could use perlbrew, a program that manages Perl installations.
Install it using apt-get install perlbrew as root
Initialize it by running perlbrew init
Add source ~/perl5/perlbrew/etc/bashrc to your .bashrc and start a new shell.
Install perl 5.10 using perlbrew install perl-5.10.1
You can now use perlbrew use to change the Perl for the current shell, or perlbrew switch to change the Perl globally.
If you only need one Perl and want to avoid the complexity of perlbrew, you can try perl-build.
Tried many things and this worked for me finally :)
Step 1: find your lib path which has all libm* files
In most systems it was under /usr/lib64. Search for the same in your machine
system:/usr/lib64$ ls libm*
libm.a libmcheck.a libmenuw.so.5 libmpc.so.3.0.0 libmpfr.so.4 libmpx.so.0.0.0 libm.so libmvec.a
libmagic.so.1 libmenu.so.5 libmenuw.so.5.9 libmpdec.so.2 libmpfr.so.4.1.4 libmpxwrappers.so.0 libmspack.so.0 libmvec_nonshared.a
libmagic.so.1.0.0 libmenu.so.5.9 libmpc.so.3 libmpdec.so.2.4.2 libmpx.so.0 libmpxwrappers.so.0.0.0 libmspack.so.0.1.0 libmvec.so
Step 2: Use the path with glibpth option while doing configure
./Configure -des -Dglibpth='/lib/lib64 /usr/lib64'
or I see some forums suggested plibpth
./Configure -des -Dplibpth='/lib/lib64 /usr/lib64' -Dglibpth='/lib/lib64 /usr/lib64' -Dlibpth='/lib/lib64 /usr/lib64'
So I am really not a Fortran programmer at all, but I have some code I am working with that uses the pgplot graphics libraries in fortran. I am able to get the code running in fortran from the console using the following commands.
gfortran -o simple discrete.f -lpgplot -IX11
discrete.f is the name of the file. So this works when I run it from the console. However, I want to run the code in the eclipse photran plugin so that I can use the debugger so that I can step through the code and observe some of the variables. I tried to put the -lpgplot and -IX11 flags in Eclipse, but I am getting errors about pgbbuf and pgnumb_ functions as undefined reference (which means that the -lpgplot function is not working when called from eclipse.
Can anyone please tell me how to set the flags correctly to run this code in Photran so that I can compile it and see the pgplot figure come up?
I am adding the console output:
02:57:05 **** Clean-only build of configuration Debug for project burglar_code_martin ****
make clean
rm -rf ./burglary_model.o burglar_code_martin
02:57:05 Build Finished (took 61ms)
02:57:05 **** Build of configuration Debug for project burglar_code_martin ****
make all
Building file: ../burglary_model.f
Invoking: GNU Fortran Compiler
gfortran -funderscoring -I/usr/lib -O0 -g -Wall -c -fmessage-length=0 -lpgplot -IX11 -o "burglary_model.o" "../burglary_model.f"
Warning: Nonconforming tab character in column 1 of line 225
Warning: Nonconforming tab character in column 1 of line 228
../burglary_model.f:155.27:
call probcheck(frac,1,outc)
1
Warning: Rank mismatch in argument 'problist' at (1) (rank-1 and scalar)
../burglary_model.f:54.33:
call probcheck(robprob,1,outcome)
1
Warning: Rank mismatch in argument 'problist' at (1) (rank-1 and scalar)
../burglary_model.f:95.30:
call probcheck(placeprob,1,outcome)
1
Warning: Rank mismatch in argument 'problist' at (1) (rank-1 and scalar)
../burglary_model.f:206.36:
subroutine output(A,burgsatloc,t,l,pic,screen,A0,Bbar)
1
Warning: Unused dummy argument 'burgsatloc' at (1)
../burglary_model.f:206.44:
subroutine output(A,burgsatloc,t,l,pic,screen,A0,Bbar)
1
Warning: Unused dummy argument 'pic' at (1)
../burglary_model.f:206.51:
subroutine output(A,burgsatloc,t,l,pic,screen,A0,Bbar)
1
Warning: Unused dummy argument 'screen' at (1)
../burglary_model.f:145.32:
integer l,pic,screen,i,j,k,PGOPEN,burgsatloc(512,*),nbar,outc
1
Warning: Unused variable 'k' declared at (1)
../burglary_model.f:146.15:
real rand,red,green,blue
1
Warning: Unused variable 'rand' declared at (1)
../burglary_model.f:143.53:
subroutine initialize(burgsatloc,B,l,pic,screen,rbar,Bbar)
1
Warning: Unused dummy argument 'screen' at (1)
../burglary_model.f:4.58:
integer i,j,n,l,pic,screen,guy,burgsatloc(512,512),k,
1
Warning: Unused variable 'k' declared at (1)
Finished building: ../burglary_model.f
Building target: burglar_code_martin
Invoking: GNU Fortran Linker
gfortran -lpgplot -IX11 -o "burglar_code_martin" ./burglary_model.o
./burglary_model.o: In function `output_':
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:241: undefined reference to `pgbbuf_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:242: undefined reference to `pgnumb_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:244: undefined reference to `pgenv_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:246: undefined reference to `pglab_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:247: undefined reference to `pgimag_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:253: undefined reference to `pgebuf_'
./burglary_model.o: In function `initialize_':
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:165: undefined reference to `pgopen_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:168: undefined reference to `pgpap_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:169: undefined reference to `pgask_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:170: undefined reference to `pgscir_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:175: undefined reference to `pgscr_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:181: undefined reference to `pgscr_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:187: undefined reference to `pgscr_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:193: undefined reference to `pgscr_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:199: undefined reference to `pgscr_'
./burglary_model.o: In function `implicit':
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:109: undefined reference to `pgclos_'
collect2: ld returned 1 exit status
make: *** [burglar_code_martin] Error 1
02:57:05 Build Finished (took 209ms)