-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Installation on OS X #1711
Comments
No, sorry, it is outdated, i recently changed a lot of things. But I do not have a Mac so I could not test this. But in this particular case, have you run git submodule update --init ? Can you check if there is actually code in libNumHop, I have had problems where the submodule failed to download. |
Ok. I'm happy to put some effort in to updating the build instructions and testing if I can get it to compile successfully. Yes, the submodules were the issue there. running
|
Thank you, it would be really nice to get that stuff working again. In this case I think that the problem is all the ifdefs used in the code. They check ifdef _WIN32 elif _ _ linux _ _ but nothing for osx. In some cases maybe the linux code works for osx aswell, its mostly about generating build scripts (but the use of gcc might need changing) Most of this code is horrible to read, I will try to improve it aftet I am done refactoring the generator code. (But this will take some time) |
To make it compile, just try to change #elif _ _ linux _ _ to #else |
…X build Note! Some functionality for OSX is missing, even if the build succeeds. Related to Hopsan#1711
I have made some of these changes in my recent pull request. But I have no way of testing them. |
I've pulled in your PR to test on os X.
it seems that the path should be This might not be related to this OS X build issue. |
Did you run 'git submodule update' ? And maybe a clean rebuild is needed. NumhopHelper.cpp includes numhop.h witch should include "numhop/Expression.h" this works with gcc at least. Could be a clang thing maybe. |
Closed it by accident. I did a git submodule update, but I did it again to be sure and after a clean build I now get:
This might be relevant? Stack Overflow: stdlocale segfault on os x |
I have updated my pull request with a commit that adds the missing header to main.cpp, lets see if it works now. Hopefully the segfault thing wont happen (from the stackoverflow link) |
Through trial and error, I have managed to make hopsan build on macos inside Travis-ci, so whenever we break macos build we will know, Since I do not have a mac, I cant test if the GUI application works.The travis build only runs non-gui tests. So there is still more work to be done. Especially on packaging. |
I’ll get on it.
…Sent from my iPhone
On 23 May 2018, at 23:25, Peter Nordin ***@***.***> wrote:
Through trial and error, I have managed to make hopsan build on macos inside Travis-ci, so whenever we break macos build we will know, Since I do not have a mac, I cant test if the GUI application works.The travis build only runs non-gui tests. So there is still more work to be done. Especially on packaging.
Maybe @magse can revisit this old code ?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.
|
You will need to rebuild the fmilibrary and qwt dependencies. |
Close! I didn't seem to have a problem with the build procedure, but when running the resultant hopsangui app in hopsan/bin I get the following crash report. it seems to not have found qt properly.
|
This is similar to a problem I got with our tests requiring FMILibrary. I hade to make the qwt.pri (In Dependencies) copy the resulting file into the bin directory. |
I think that hopsangui should be able to start now after my latest changes. |
OK some things to try. First of all don't include the xml files into the code. This will cause compilation error as they do not contain valid c/c++ code. (Its xml formated text). Instead include the .hpp file where you implemented your component. It seems to be missing in this case. Lets see if that solves the problem. The xml files are used to decribe the visual appearance of the component. The code implements the equations. |
You can also try HoLC (Hopsan library creator) to generate the library files automatically. (If you can compile it). Unfortunately the compile features of holc and hopsan gui do not yet work on mac, due to being hard-coded for GCC. So you will still need to use xcode to compile the library. |
Yes you are right, it compiled with the correct source file. But since i have made a project for a command line tool i now have to set up a new one with a makefile instead (think this is the only way to do it in Xcode after some research), are there any makefile that could be to some help to start from in the Hopsan source since i have not done this before? |
No there are no makefiles in the code, especially not for macOS, but you can use the same method as HopsanGenerator when compiling. Use a script that calls the compiler directly. Then you can code in xcode and then run the script manually to build the library. Unfortunately I can not give you an example (you need to run it on linux or windows). But maybe @robbr48 can help you. Its a really simple script that just calls the compiler directly (clang in your case) with some flags. You can also look in the HopsanGenerator code and see if you can find the code that generates the script and see what to write. It will be something similar to: But you should not use gcc |
Here is a copy of the generated script for the example library from Kubuntu, debug mode Here is for release mode #!/bin/sh |
I do not think that -Wl,--rpath,"..." is neede, also, it wont work on macOS |
Okey thank you! |
I forgot to mention, the most obvious way to include your components. Since you are already building Hopsan from source, you can include you code in the default library, or maybe the exampleComponentLibrary, then it will be built using the Hopsan build system every time you rerun the Hopsan build. |
Hello @peterNordin, After some tries and some reading around on stack overflow i found this: Thanks for the help! |
Hello,
Has anyone recently built the application for OS X?
The scripts in buildMacApp seem out of date. I have followed most of the instructions for debian/unix build but I have the following error when building in QTcreator.
The text was updated successfully, but these errors were encountered: