Conversation
There was a problem hiding this comment.
Ok, this didn't work for me. Not because your hack didn't do what it was supposed to, but because in addition RST wasn't correctly linking to my libraries. What I needed to do was:
-
Add
-I/opt/local/includeto mymakebin.darwinfile on line 10. This is where mypng.hfile was located and meant I got past the issue of finding it without needing to change the specific file called out in your tutorial below. -
Adding
-L/opt/local/libto LFLAGS on line 29 of makebin.darwin.
The installed libraries weren't being detected correctly (-lpng, -lcdf, -lnetcdf). I tested adding -L/opt/local/lib (my library location) to the individual makefiles after the offending flags and that worked. I then tested the more general fix, which also worked.
This leads me to suspect that your installation issue might be solved by only applying point (1). If so, we might be able to solve this problem by adding instructions to alter the makebin, which is more top level and therefore a more desirable solution in my opinion.
There is also a change in the way that the CDF libraries are installed (at least on Mac). We probably need to revisit the way our environment variables are set to better link to the available libraries and header file locations. That would be even better than asking users to alter the makebin files.
The individual comments below are suggestions for better implementing your fix. However, if altering makebin.darwin also works for you, I think that's the more appropriate hack.
| not required). | ||
|
|
||
| 2. Load the RST environment variables. Open and edit your `~/.bashrc` file to include: | ||
| 3. When compiling RST later, `png.c`, located in `/RSTINSTALLLOCATION/codebase/base/src.lib/graphic/fbuffer.1.19/src/png.c`, doesn't seem to find the `png.h` header file correctly, even though it is located in the XPATH defined in the previous step. As a patch fix while we work out what to do more cleanly, you need to change a line to point directly to `png.h` |
There was a problem hiding this comment.
| 3. When compiling RST later, `png.c`, located in `/RSTINSTALLLOCATION/codebase/base/src.lib/graphic/fbuffer.1.19/src/png.c`, doesn't seem to find the `png.h` header file correctly, even though it is located in the XPATH defined in the previous step. As a patch fix while we work out what to do more cleanly, you need to change a line to point directly to `png.h` | |
| 3. When compiling RST later, `png.c`, located in `$RSTPATH/codebase/base/src.lib/graphic/fbuffer.1.19/src/png.c`, doesn't seem to find the `png.h` header file correctly, even though it is located in the XPATH defined in the previous step. As a patch fix while we work out what to do more cleanly, you need to change a line to point directly to `png.h` |
There was a problem hiding this comment.
I recommend putting this whole section in "Troubleshooting" with an example of the error message that pops up when things aren't working correctly.
| 2. Load the RST environment variables. Open and edit your `~/.bashrc` file to include: | ||
| 3. When compiling RST later, `png.c`, located in `/RSTINSTALLLOCATION/codebase/base/src.lib/graphic/fbuffer.1.19/src/png.c`, doesn't seem to find the `png.h` header file correctly, even though it is located in the XPATH defined in the previous step. As a patch fix while we work out what to do more cleanly, you need to change a line to point directly to `png.h` | ||
|
|
||
| - Go to `png.c` and change line 32 `#png.h>` to `#include </opt/X11/include/png.h>` or `#include </usr/X11/include/png.h>`, for ARM and x86-based Macs, respectively. If your compilation still errors on `png.c`, make sure this is pointed to `png.h` correctly on your machine. |
There was a problem hiding this comment.
This is too specific. My png.h header was not located under X11. Instead, I recommend directing users to find the location of their png.h header using something like: find /opt/ -type f -name 'png.h' or find /usr/ -type f -name 'png.h'
|
I agree @aburrell that a more top level solution would be better. I tried out your fix, pointing to the location of png.h in These errors are likely very device specific, and may vary depending on how much the installation environment has changed since the user got their Mac. As an example, this install with these errors was on a brand new Mac mini. When I tried to reproduce it on my older Macbook, I got different errors, but that is probably related to the fact that I had a weird homebrew setup. |
|
@billetd ok, based on the fix that worked for me not working for you, I double down on my suggestion to put the fix for this in the "Troubleshooting" section of the install guide. Ideally, including some details about what systems are more likely to fail as well. |
|
@aburrell and @billetd I appreciate the support with this but still struggling to install this. Currently failing at
my netcdf.h file is here: |
|
If you try Dan's hack of changing the line in the file to be |
|
@aburrell still the same problem. 👎 |
|
@mtwalach what are your system and compiler details? |
|
It's an Apple M3 with Sequoia 15....is that the info you're after? |
|
Assuming you have your If it's the latter, could be worth double checking your .zshrc file is loading in your paths correctly. Or manually going to everything that wants netcdf and pointing it to the right header manually. |
|
Yes, that's a good chunk of it. If you use GCC instead of clang, it might work. I'm on intel, but also have Sequoia. |
I recently successfully installed RST on an M4 Pro Mac mini with surprisingly minimal problems. This update to the Mac install guide chronicles exactly what I needed to do to get it working.
This should hopefully help alleviate the problems with Mac installations, e.g. #609
The biggest changes are related to ensuring the x86 versions of Homebrew and netcdf are installed, along with a fix for the
png.ccompilation error. The latter is a hack, because for some reason it can't findpng.hon compilation, even when XPATH is defined correctly (andpng.his in there). I'm not sure why this is the case, but no matter what you set XPATH too (even wherepng.his directly in the top level), it doesn't work.One thing to note is that I only did this with Homebrew, and not Macports. Many of the changes may apply to Macports enjoyers, but for now, I recommend using Homebrew.