-
Notifications
You must be signed in to change notification settings - Fork 58
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
Building on Mac #4
Comments
Thanks for filing the issue, hopefully we can get this working so I can add a build option for mac. The problem is I have no experience w/ mac so I may not be a ton of help. The error indicates a problem linking w/ the openssl and uv libraries. First, can you check to see you have these two libraries installed in the standard path. Also, since libuv is not necessary on linux I don't have it in the makefile. Try changing the following line in objects.mk from If possible keep track of any changes you make along the way so I can update the project once we get this working. -jon |
I do have both installed already: Adding the -luv at the end of the objects.mk seems to have taken care of the second half of the errors I was getting before, as I now only get the first half:
I will be sure to track any changes I make from here on out. |
Those functions are from the crypto library. Trying adding -lcrypto after -luv |
I've tried for so long to make this work ... To think it was as simple as adding some flags. Due to my ignorance I didn't know which ones to add. I'll have to test it out later, but I think it has all worked out. Thank you very much. I will update later this week if I find any more problems. |
Glad it worked. I think you may have an issue using sigwait instead of sigtimedwait, the latter returns the singal number (> 0) on success and the former sets the 'sig' arg and returns 0. Also sigtimedwait will simply poll and return immediately while sigwait will block. In your update I think you'll freeze in the destructor: either the sigwait will hang or you'll never break out of the empty while loop. I remember this was a pain to get working in the first place and sigtimedwait was one of the few ways to get everything to work. May need to do some googling to find an alternative. |
I just pushed a new branch 'mac-build' that fixes the things you mentioned and adds a workaround to the 'sigtimedwait' issue that appears to work on linux - so far. When you get a chance switch over to that branch and let me know if you're able to build w/o having to change anything. |
With no changes your mac-build branch built the libTDAmeritradeAPI.so wonderfully. I see you ended up with a better ~signalBlocker() too ... I discovered that you were right about it hanging in the version I posted |
I merged these updates to master EXCEPT -luv, which should be manually added to objects.mk. (The makefiles are automatically generated and I didn't want to force an unnecessary dependency on linux; hopefully at some point I'll convert this to a makefile project for a more portable build.) |
brw59, I'm trying to transition to a single makefile build. If you have a minute can you checkout branch 'to-makefile-project' and try to build w/ thanks |
Jeog thanks for your work on this. I'm trying to build this on a mac (OS 10.14.6) and am getting the error:
Same error on master, mac-build, and to-makefile-project branches. |
That's coming from the external json header/library. I'll have to take a look at their docs and see what exactly that error message means because I haven't seen it before. But first, can you try replacing line 30 in tdma_common.h
with
and see what happens |
I made the suggested edit but am still getting the same error. Searching turned up some possibilities: https://github.com/nlohmann/json/issues/539
https://github.com/nlohmann/json/issues/917
|
Those functions shouldn't have to be defined since we're only parsing json strings and creating json objects through inline initializers which should all be supported by default. It seems to be when compiled with msvc, and gcc. Can you paste an example of the compile command make is using (make clean, make -n will do a dry run and spit out the commands). |
Using the mac-build branch and make clean, make -n gives this output:
|
Thanks, the problem seems to be related to initializing/assigning json objects from stl objects in streaming.cpp that, for some reason, json.hpp is not recognizing and trying to look for custom to_json methods. I'll have to investigate, if I can't find anything I'll file an issue with the json project. One thing to try is replace include/json.hpp with the most recent version: https://github.com/nlohmann/json/tree/develop/single_include/nlohmann. Maybe something was changed/fixed since I included it months ago. If you notice any other errors in the compile output please share. |
Looks like the error is due to the version of json that is included. I included version 3.7.0 and make got past the previous error. Now it's getting to the -lssl flag and failing to find it on my system, despite using Hombrew's instructions for setup:
I'm working on getting this fixed (@brw59 did you have this issue?), and will post an update when I have one. |
Alright the openssl issue is resolved. For my system the fix was:
I found it at brianmario/mysql2#795 (for future searchers). After that make ran without errors, the Python installation worked, and I can import tdma_api. Will let you know if I run into any issues, thank you for your input @jeog. |
good to hear, I just pushed a commit to master w/ the most recent json.hpp |
|
I'm getting this issue even after including openssl in LIBRARY_PATH
|
Doing this resolved the SSL error |
I'm on Mac with the M1 (ARM) chip and had the same issue as @krishna919 but their solution of creating a symbolic link didn't work for me. After trying everything, the only way I got it to work was by making small changes to the makefile. For anyone else with an M1 chip that's having issues, use homebrew to install openssl and libuv. Then in the makefile add:
Then when invoking g++ for libTDAmeritradeAPI.so, append $(LDFLAGS)
And the same for src and uWebSockets except append $(CPPFLAGS) instead
If anyone has an easier solution that doesn't involve changing the makefile, please let me know. |
I would really like to be able to run your library on a Mac.
Your readme says: "For Mac OS/X you'll have to download/install the necessary libraries and adjust the makefiles."
What is it that I'm supposed to change?
Here is my process ... starting from a fresh download of your repo:
2a) errors come up ... add "std::" before 'nullptr_t' to fix them:
5a) replace this:
with this:
(I think it probably will do the same thing)
6) 'make clean'
7) 'make'
7a) For all that I try, I cannot get past this point. I keep getting the "ld: symbol(s) not found for architecture x86_64" error, which doesn't make sense to me since I'm compiling from scratch. ... And just to point out, the online suggestions of reinstalling the command line tools on Mac doesn't work either.
... Here's the error when it tries to create the libTDAmeritradeAPI.so file at the end of the 'make' command:
Any idea for how to fix this?
The text was updated successfully, but these errors were encountered: