librsl_lite.a': No such file

All topics related to compiling WRF, including environment set-up, and library installation
Post Reply
marto1980
Posts: 10
Joined: Sat May 02, 2020 5:50 pm

librsl_lite.a': No such file

Post by marto1980 » Thu May 21, 2020 6:51 am

Hello,

I am following https://www2.mmm.ucar.edu/wrf/OnLineTut ... torial.php to compile WRF Model Version 4.2 on my x86_64 BSD machine with mpich, gfortran and gcc. I am running DragonFly-5.8.1 on an ASUS ZENBOOK PRO I7-7700HQ/16GB/512GB SSD BLACK, Notebook mit 15,6 inch Display, Core i7 Processor, 16 GB RAM, 512 GB SSD, GeForce GTX1050. My plan is to compile and run WRF locally on this machine with MPICH. More info on my compilers and hardware is available in my previous post on the configure options: https://forum.mmm.ucar.edu/phpBB3/viewt ... =37&t=9090.

Before configure and compile, I comment all includes of malloc.h like this, as I was advised in a BSD forum:

"
find . -type f -exec sed -i '' 's/\#include <malloc.h>/\/*\#include <malloc.h> \*\//' {} \;
find . -type f -exec sed -i '' 's/\# include <malloc.h>/\/*\# include <malloc.h> \*\//' {} \;
find . -type f -exec sed -i '' 's/\# include <malloc\/malloc.h>/\/*\# include <malloc\/malloc.h> \*\//' {} \;
find . -type f -exec sed -i '' 's/\# include <malloc.h>/\/*\# include <malloc.h> \*\//' {} \;
find . -type f -exec sed -i '' 's/\#include <sys\/malloc.h>/\/*\# include <sys\/malloc.h> \*\//' {} \;
"

Then I run the configure script (configure.wrf is attached).
Finally, I run "./compile em_real >& log.compile" (log.compile is attached).

Notable errors are:

"
/usr/libexec/binutils227/elf/ar: rsl_malloc.o: No such file or directory
*** [librsl_lite.a] Error code 1 (ignored)
/usr/libexec/binutils227/elf/ranlib: '/home/marto/WRF/Build_WRF/WRF/external/RSL_LITE/librsl_lite.a': No such file
"
and

"
sed: module_model_constants.F: No such file or directory
Fatal Error: Cannot open module file 'module_model_constants.mod' for reading at (1): No such file or directory
"

I am looking forward to your reply.

Best regards,
Martin
Attachments
log.compile
(906.85 KiB) Downloaded 34 times
configure.wrf
(20.49 KiB) Downloaded 36 times

Ming Chen
Posts: 1482
Joined: Mon Apr 23, 2018 9:42 pm

Re: librsl_lite.a': No such file

Post by Ming Chen » Fri May 22, 2020 12:26 am

Is there any special reason why you comment all includes of malloc.h ? I talked to our software engineer about your case, and we cannot figure out the reasons for those weird errors shown in your log file.
WRF Help Desk

marto1980
Posts: 10
Joined: Sat May 02, 2020 5:50 pm

Re: librsl_lite.a': No such file

Post by marto1980 » Fri May 22, 2020 6:06 am

Hello Mr Chen,

Thank you very much for your reply. I cleaned the repository and made a new build without commenting the malloc.h includes. The respective configure.wrf and log.compile files are attached.

Any clues would be welcome. If it turns a dead end, I will try the compilation on OpenBSD and finally on Linux. Maybe a successful compilation there will provide some hints why it fails on DragonFly?
Attachments
log.compile
(901.36 KiB) Downloaded 41 times
configure.wrf
(20.49 KiB) Downloaded 33 times

Ming Chen
Posts: 1482
Joined: Mon Apr 23, 2018 9:42 pm

Re: librsl_lite.a': No such file

Post by Ming Chen » Fri May 22, 2020 10:45 pm

Hi,
I cannot repeat your error using the same compiler. I am perplexed by this error message. I did a research and it seems that <malloc.h> is somehow not-C-standard, but linux-specific. Below are a few options that you can try:
(1) Include <stdlib.h> instead of <malloc.h>;
or
(2) #ifndef __clang__
# include <malloc.h>
#endif

I am not 100% sure whether the above options can solve your problem. Please try and let me know whether it works.

Many compiling issues are related to the OS, library and environmental settings. It is hard to know for sure if we cannot repeat the problem here. Please keep me updated if you make it work. Such information will be helpful for others who have the similar issue.
WRF Help Desk

marto1980
Posts: 10
Joined: Sat May 02, 2020 5:50 pm

Re: librsl_lite.a': No such file

Post by marto1980 » Mon May 25, 2020 7:08 pm

Hello Mr Chen,

Thank you very much for your reply. So I replaced the includes of malloc.h by stdlib.h as follows:

Code: Select all

find . -type f -exec sed -i '' 's/\#include <malloc.h>/\#include <stdlib.h> /' {} \;
find . -type f -exec sed -i '' 's/\# include <malloc.h>/\# include <stdlib.h> /' {} \;
find . -type f -exec sed -i '' 's/\# include <malloc\/malloc.h>/\# include <stdlib.h> /' {} \;
find . -type f -exec sed -i '' 's/\#  include <malloc.h>/\# include <stdlib.h> /' {} \;
find . -type f -exec sed -i '' 's/\#include <sys\/malloc.h>/\# include <stdlib.h> /' {} \;
and then tried again to compile em_real. The compilation stopped after about 10 minutes, the configure.wrf and log.compile files are attached. The errors are very similar to previous failed compilation attempts.

I notice that there are three types of malloc.h includes:

Code: Select all

# include <malloc.h>

Code: Select all

# include <malloc/malloc.h>
as well as

Code: Select all

# include <sys/malloc.h>
You may notice that in this compilation attempt I replaced all of them by

Code: Select all

# include <stdlib.h>
I found on my system there is a malloc.h file in /sys/sys/malloc.h. Maybe I should try replacing

Code: Select all

# include <sys/malloc.h> 
by

Code: Select all

# include <sys/sys/malloc.h>
?
However, I have no clue about how

Code: Select all

# include <malloc/malloc.h>
should be replaced ...

I also found this website (http://people.atmos.ucla.edu/fovell/WRF/WRF_ports.html) that explains how to port WRF to different operating systems. There are some instructions also for FreeBSD at the end. The instructions are however, obsolete, maybe we can update them?

Thank you very much for your help.

Best regards,
Martin
Attachments
log.compile
(1009.24 KiB) Downloaded 32 times
configure.wrf
(20.49 KiB) Downloaded 39 times

Ming Chen
Posts: 1482
Joined: Mon Apr 23, 2018 9:42 pm

Re: librsl_lite.a': No such file

Post by Ming Chen » Tue May 26, 2020 5:42 pm

Martin,
Thank you for the detailed description of the problem. At present I have no solutions to the problems. I will talk to our software engineers and see whether they have ideas. They might be able to talk to you directly. Otherwise I will keep you updated about the feedback. Thanks for your patience.
WRF Help Desk

marto1980
Posts: 10
Joined: Sat May 02, 2020 5:50 pm

Re: librsl_lite.a': No such file

Post by marto1980 » Wed May 27, 2020 5:28 am

Hello Mr Chen,

Thank you very much for your help. I am also already in contact with BSD developers that may help get this compiled. I would also be very happy to keep in touch.

I first problem I found is that in BSD systems there is no mallinfo() function. I guess one will have to combine several BSD functions to get the structure returned by mallinfo. But currently I do not know which.

Best regards,
Martin

davegill
Posts: 90
Joined: Mon Apr 23, 2018 9:03 pm

Re: librsl_lite.a': No such file

Post by davegill » Wed May 27, 2020 2:56 pm

May I steer you in a completely other direction?

Take a look at this repo on github:
https://github.com/davegill/wrf-coop

You can get the entire repository on your local machine with the command

Code: Select all

git clone https://github.com/davegill/wrf-coop
Particularly, look at this README file (it is designed to be "read" it on github, with all of the markdown).
https://github.com/davegill/wrf-coop/bl ... utorial.md

This is a step-by-step process to walk a user through building and running the WPS and WRF systems from within a docker container. The docker capability is not really a viable solution for a large machine, but for a single node desktop or laptop, the docker solution should be effective.
Dave Gill
NCAR/MMM

Ming Chen
Posts: 1482
Joined: Mon Apr 23, 2018 9:42 pm

Re: librsl_lite.a': No such file

Post by Ming Chen » Wed May 27, 2020 4:56 pm

Dave,
Thank you very much!

Martin,
Please follow the instruction dave provided and let us know if you have any question.
WRF Help Desk

marto1980
Posts: 10
Joined: Sat May 02, 2020 5:50 pm

Re: librsl_lite.a': No such file

Post by marto1980 » Thu May 28, 2020 6:16 am

Hello,
@Chen, @davegill: Thank you very much for your replies and your helpfulness.
Running WRF in a docker container is not an option for me. I would rather use Linux than BSD to run WRF. The reason I selected DragonFly BSD is performance.

I have already started patching the sources and compiling and I am really coming forward. I also use help from porters of Linux packages to BSD. If I fail at my attempt to compile WRF on BSD, I will do that on Linux. Anyway, porting WRF to BSD is an interesting challenge for me and I am willing to give it a try. In the meantime, may I ask you again for help if I come to a dead end? I guess there are still some things where clues from your side may be useful.

Best regards,

Martin

Ming Chen
Posts: 1482
Joined: Mon Apr 23, 2018 9:42 pm

Re: librsl_lite.a': No such file

Post by Ming Chen » Thu May 28, 2020 4:31 pm

Martin,

Yes please try and let us know if you have problems, --- we will do our best to help, although sometimes we also may get lost. We will try.
WRF Help Desk

ucabella
Posts: 1
Joined: Mon Aug 31, 2020 5:10 am

Re: librsl_lite.a': No such file

Post by ucabella » Mon Aug 31, 2020 5:27 am

marto1980 wrote:
Thu May 21, 2020 6:51 am
Hello,

I am following https://www2.mmm.ucar.edu/wrf/OnLineTut ... torial.php to compile WRF Model Version 4.2 on my x86_64 BSD machine with mpich, gfortran and gcc. I am running DragonFly-5.8.1 on an ASUS ZENBOOK PRO I7-7700HQ/16GB/512GB SSD BLACK, Notebook mit 15,6 inch Display, Core i7 Processor, 16 GB RAM, 512 GB SSD, GeForce GTX1050. My plan is to compile and run WRF locally on this machine with MPICH. More info on my compilers and hardware is available in my previous post on the configure options: viewtopic.php?f=37&t=9090.

Before configure and compile, I comment all includes of malloc.h like this, as I was advised in a BSD forum:

"
find . -type f -exec sed -i '' 's/\#include <malloc.h>/\/*\#include <malloc.h> \*\//' {} \;
find . -type f -exec sed -i '' 's/\# include <malloc.h>/\/*\# include <malloc.h> \*\//' {} \;
find . -type f -exec sed -i '' 's/\# include <malloc\/malloc.h>/\/*\# include <malloc\/malloc.h> \*\//' {} \;
find . -type f -exec sed -i '' 's/\# include <malloc.h>/\/*\# include <malloc.h> \*\//' {} \;
find . -type f -exec sed -i '' 's/\#include <sys\/malloc.h>/\/*\# include <sys\/malloc.h> \*\//' {} \;
"

Then I run the configure script (configure.wrf is attached).
Finally, I run "./compile em_real >& log.compile" (log.compile is attached).

Notable errors are:

"
/usr/libexec/binutils227/elf/ar: rsl_malloc.o: No such file or directory
*** [librsl_lite.a] Error code 1 (ignored)
/usr/libexec/binutils227/elf/ranlib: '/home/marto/WRF/Build_WRF/WRF/external/RSL_LITE/librsl_lite.a': No such file
"
and

"
sed: module_model_constants.F: No such file or directory
Fatal Error: Cannot open module file 'module_model_constants.mod' for reading at (1): No such file or directory
"

I am looking forward to your reply.

Best regards,
Martin
I have a same issue. Any update on this?

Looking forward for a solution.

Thanks in advance.

rpasken
Posts: 2
Joined: Wed Apr 07, 2021 12:25 pm

Re: librsl_lite.a': No such file

Post by rpasken » Wed Apr 07, 2021 12:47 pm

I am also having similar problems. I am attempting to move away from Linux to FreeBSD because of the Centos-7/Centos-8 debacle and stability problems caused by systemd panics. I have used FreeBSD pkg packaging system to download NetCDF, HDF5 and mpich. I have successfully compiled and installed NCAR graphics with NCL activated, PynNo and PyNGL. In FreeBSD-12.2 malloc.h is located in /usr/include rather than /usr/include/malloc so the simple fix was to put a copy of malloc.h in /usr/include/malloc after creating it. The problem now is that when compiling WRF modules although they are built correctly. For example in external/esmf_time_f90 the module esmf_basetimemod.mod is created and has a non-zero size the module cannot be found later in the compile. I modified configure to recognize FreeBSD and modified the Mac-OSX stanza from configure.defaults to a include FreeBSD entry. I also tried the configure.wrf included on the previous emails with the same results. I have tried V3.7, V3.9 and V4.1 all with the same results

rpasken
Posts: 2
Joined: Wed Apr 07, 2021 12:25 pm

Re: librsl_lite.a': No such file

Post by rpasken » Thu Apr 08, 2021 10:47 pm

I have spent some more time looking at the compile logs. It seems that even though the file exists (for instance module_model_constants.F) sed cannot find the file.

Post Reply

Return to “WRF Compiling/Installation”