Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

librsl_lite.a': No such file

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.

marto1980

New member
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/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
 

Attachments

  • configure.wrf
    20.5 KB · Views: 73
  • log.compile
    906.8 KB · Views: 73
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.
 
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

  • configure.wrf
    20.5 KB · Views: 76
  • log.compile
    901.4 KB · Views: 82
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.
 
Hello Mr Chen,

Thank you very much for your reply. So I replaced the includes of malloc.h by stdlib.h as follows:
Code:
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:
# include <malloc.h>
Code:
# include <malloc/malloc.h>
as well as
Code:
# include <sys/malloc.h>
You may notice that in this compilation attempt I replaced all of them by
Code:
# 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:
# include <sys/malloc.h>
by
Code:
# include <sys/sys/malloc.h>
?
However, I have no clue about how
Code:
# 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

  • configure.wrf
    20.5 KB · Views: 75
  • log.compile
    1,009.2 KB · Views: 69
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.
 
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
 
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:
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/blob/master/README_tutorial.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,
Thank you very much!

Martin,
Please follow the instruction dave provided and let us know if you have any question.
 
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
 
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.
 
marto1980 said:
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/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.
 
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
 
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.
 
Top