Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 30-05-2024, 15:26   #16
Registered User

Join Date: Dec 2017
Location: Circumnavigating - in phases
Boat: Feltz, One Off, 40 ft
Posts: 43
Re: Compiling for Apple Silicon

Somehow I missed your earlier reply. It doesn't make sense indeed. Though ... I am specifying the MACOSX_DEPLOYMENT_TARGET environment variable. That is part of the instructions (https://opencpn-manuals.github.io/ma...d_instructions) right? Or should I remove that one?


(and yes, before making I remove the build dir. thx)
wernertoonk is offline   Reply With Quote
Old 30-05-2024, 15:47   #17
Registered User

Join Date: Dec 2017
Location: Circumnavigating - in phases
Boat: Feltz, One Off, 40 ft
Posts: 43
Re: Compiling for Apple Silicon

I might have found the cause of the errors, though I am not too sure. Default shell on macOs is zsh. There I got the errors. When I changed to bash, updated the PATH and environment settings there, the building worked.

Now, just to double check, currently this is in ~/.bash_profile

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"'
export PATH="/opt/homebrew/opt/libarchive/bin:$PATH"
export LDFLAGS="-L/opt/homebrew/opt/libarchive/lib"
export CPPFLAGS="-I/opt/homebrew/opt/libarchive/include"

I am not sure about both FLAGS. Could or should I remove these perhaps? Don't see them any more in the instructions, though n 2022 they were necessary. Might have been changed over time?
wernertoonk is offline   Reply With Quote
Old 30-05-2024, 16:03   #18
Registered User

Join Date: Dec 2017
Location: Circumnavigating - in phases
Boat: Feltz, One Off, 40 ft
Posts: 43
Re: Compiling for Apple Silicon

Now, after building the 1st time, the following files have been created:
/usr/local/include/archive.h
/usr/local/lib/libarchive.13.dylib

And then ... while building the 2nd time, the script fails on: ln -s /usr/local/include/archive.h: File exists

On a build server (that starts with a clean environment everytime) this won't happen. Though locally the build will fail. How to force an overwrite here? Should I add '-sf' instead of the '-s' here?
wernertoonk is offline   Reply With Quote
Old 31-05-2024, 01:02   #19
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 320
Re: Compiling for Apple Silicon

The build file is ci/circleci-build-macOS.sh and not ci/generic-build-macos.sh

You must have the wrong setup.
__________________
If all else fails, read the instructions.
Antipole is offline   Reply With Quote
Old 31-05-2024, 14:05   #20
Registered User

Join Date: Dec 2017
Location: Circumnavigating - in phases
Boat: Feltz, One Off, 40 ft
Posts: 43
Re: Compiling for Apple Silicon

Thx @Antipole. Very much appreciated.
The manual says (literally): "Run the build script (ci/generic-build-macos.sh)"
You say: "The build file is ci/circleci-build-macOS.sh and not ci/generic-build-macos.sh"

Then it seems logical that one of them is untrue - or that there are multiple build files. Would be good to sort that out, so that info in the manual and here on the forum is correct. Right?

Any clue by the way why there are (at least) 2 manuals, that seem unlinked? There is the OpenCPN Developer Manual here https://opencpn-manuals.github.io/de...3.1/index.html
And there is the OpenCPN Programming manual here: https://opencpn-manuals.github.io/ma...dev/index.html

Perhaps someone else has more info on that?

I am just trying to find my way again (after a few years) to create another new (and very useful) plugin. And yes, regarding my setup, there will be things wrong. I'm working on sorting that out.
wernertoonk is offline   Reply With Quote
Old 31-05-2024, 15:54   #21
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,239
Re: Compiling for Apple Silicon

The script is ci/generic-build-macos.sh, ci/circleci-build-macOS.sh does not even exist.
The only current manual relevant to the current codebase is https://opencpn-manuals.github.io/ma...dev/index.html (Or it's AsciiDoc source in the source tree)
You do not need to run ci/generic-build-macos.sh on subsequent builds, everything you need was already installed.
There is no need to use bash for the build, I do build from zsh.
I do not have any of the Homebrew related environement variables you mention set on my system.
If you are setting MACOSX_DEPLOYMENT_TARGET to 10.10, set it to 11 instead or do not set it to anything at all, it is not needed for your local development builds.
nohal is online now   Reply With Quote
Old 01-06-2024, 00:16   #22
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 320
Re: Compiling for Apple Silicon

Quote:
Originally Posted by nohal View Post
The script is ci/generic-build-macos.sh, ci/circleci-build-macOS.sh does not even exist.
@rasbats Now I am confused. I use ci/circleci-build-macOS.sh following shipdriver. Can you elucidate?
Antipole is offline   Reply With Quote
Old 01-06-2024, 02:24   #23
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,239
Re: Compiling for Apple Silicon

He is trying to build OpenCPN application, not a plugin.
nohal is online now   Reply With Quote
Old 01-06-2024, 03:41   #24
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 320
Re: Compiling for Apple Silicon

Quote:
Originally Posted by nohal View Post
He is trying to build OpenCPN application, not a plugin.
Stupid me! Of course. Please forget what I said.
Antipole is offline   Reply With Quote
Old 01-06-2024, 05:49   #25
Registered User

Join Date: Dec 2017
Location: Circumnavigating - in phases
Boat: Feltz, One Off, 40 ft
Posts: 43
Re: Compiling for Apple Silicon

Thx both! I am trying to build OpenCPN, true, ... only to be able to create a new plugin (as in to setup a working dev environment).

Regarding the plugins: is there a fasttrack / manual for that as well?

Regarding the environment: I will remove the settings from the configuration file. That must the issue then on my side.
wernertoonk is offline   Reply With Quote
Old 01-06-2024, 06:05   #26
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,239
Re: Compiling for Apple Silicon

https://opencpn-manuals.github.io/ma...-overview.html

Just take an existing plugin and start from that. I personally prefer the Shipdriver template.
nohal is online now   Reply With Quote
Old 01-06-2024, 09:50   #27
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 320
Re: Compiling for Apple Silicon

@wernertoonk I have been developing the JavaScript plugin for some years. I am Mac based (now M2).

Never needed to build OCPN. Have always used the ready-built installers.
__________________
If all else fails, read the instructions.
Antipole is offline   Reply With Quote
Old 02-06-2024, 08:27   #28
Registered User

Join Date: Dec 2017
Location: Circumnavigating - in phases
Boat: Feltz, One Off, 40 ft
Posts: 43
Re: Compiling for Apple Silicon

Thx @antipole. I also have no need to build OpenCPN. A few years ago though one had to make sure there was a working dev environment to do this, before starting on plugins (according to the manual back then). Perhaps that wasn't and isn't necessary (anymore). Great! My focus is on a new plugin, not on the main program.

What do you use the javascript plugin for? #curious
wernertoonk is offline   Reply With Quote
Old 02-06-2024, 09:09   #29
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 320
Re: Compiling for Apple Silicon

Quote:
Originally Posted by wernertoonk View Post
What do you use the javascript plugin for? #curious
Read here
https://opencpn.org/OpenCPN/plugins/javascript.html
Antipole is offline   Reply With Quote
Old 02-06-2024, 10:50   #30
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,239
Re: Compiling for Apple Silicon

Quote:
Originally Posted by wernertoonk View Post
Thx @antipole. I also have no need to build OpenCPN. A few years ago though one had to make sure there was a working dev environment to do this, before starting on plugins (according to the manual back then). Perhaps that wasn't and isn't necessary (anymore). Great! My focus is on a new plugin, not on the main program.
You of course still need a working build environment even to build plugins, the easiest way to make sure you do have a working build environment with all dependencies is to build the OpenCPN main program.
nohal is online now   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Advertise Here
  Vendor Spotlight
No Threads to Display.


All times are GMT -7. The time now is 16:31.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.