Skip to content
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

cross compiling support #125 #158

Merged
merged 4 commits into from Jun 24, 2017
Merged

cross compiling support #125 #158

merged 4 commits into from Jun 24, 2017

Conversation

sharathbaddam
Copy link
Contributor

Hello,

I made minor changes in build_libzmq.sh, which solves the cross compiling problem from #125
Also, added documentation on how to use it.

@interpretor
Copy link
Member

Thanks for investigation!
I think it's a good idea to be able to change the config parameters. But I'm not happy with your documentation, it does not tell the whole story. In my opinion, it should contain all steps to achieve a working cross compiled package. Maybe we can add a new Travis-CI job to generate prebuilds also for common ARM architectures.

@rgbkrk @lgeiger what do you think about prebuilds for ARM based devices? It would heavily speed up deployment and updates on embedded systems. Cross compilers should be available in the Ubuntu repositories, so it would be one additional Travis job.

@rgbkrk
Copy link
Member

rgbkrk commented Jun 19, 2017

I'd totally be a fan of prebuilds for ARM based devices. Could the same cross compilers be used to build the Linux 32 bit binaries too?

@interpretor interpretor self-requested a review June 19, 2017 16:39
@interpretor
Copy link
Member

I'll investigate that as soon as I have time.

@sharathbaddam
Copy link
Contributor Author

@interpretor I can add more documentation with complete steps for cross compiling, if you agree with the changes in build_libzmq.sh.

It would be awesome for have prebuilds for ARM based devices.

@interpretor
Copy link
Member

Please tell me your steps, so I can reproduce it on my side and test it.

@sharathbaddam
Copy link
Contributor Author

@interpretor here are the steps :-

  1. Get cross-compilation environment setup – I used this “environment-setup-cortexa8hf-vfp-neon-oe-linux-gnueabi ”
  2. Create a directory – I created “testzeromq/node_modules ”
  3. Clone ZeroMQ library from GitHub to newly created directory.
  4. Create a shell script with following in it –
. /usr/local/slp-redwolf-x86_64/environment-setup-cortexa8hf-vfp-neon-oe-linux-gnueabi
export ZMQJS_OPTIONS="--host=arm-oe-linux-gnueabi"
cd testzeromq/node_modules/zeromq.js
npm install --arch=arm-oe-linux-gnueabi
##
# Done 
  1. Run the script – sh zmqbuild.sh
  2. When you run the script you would notice some of the following information about cross compilation :-
configure: loading site script /usr/local/slp-redwolf-x86_64/site-config-cortexa8hf-vfp-neon-oe-linux-gnueabi
...
checking whether we are cross compiling... yes
..
checking host system type... arm-oe-linux-gnueabi
..
...
....
Succesfully build libzmq on Thu Jun 22 2017 17:10:34 GMT+0200 (CEST)
make: Entering directory `/home/tester/testzeromq/node_modules/zeromq.js/build'
  CXX(target) Release/obj.target/zmq/binding.o
  SOLINK_MODULE(target) Release/obj.target/zmq.node
  COPY Release/zmq.node
make: Leaving directory `/home/tester/testzeromq/node_modules/zeromq.js/build'

let me know if this works for you!!

@sharathbaddam
Copy link
Contributor Author

My bad, I accidentally clicked on "Close and comment".

@interpretor
Copy link
Member

interpretor commented Jun 24, 2017

I don't have yet tested it on all common cross-compilers, but the idea of the build options environment variable is nice and useful.
Let's rename the variable to match the naming already used in the script? I would suggest ZMQ_BUILD_OPTIONS. And we should quote the variable: "${ZMQ_BUILD_OPTIONS}"

And maybe remove the documentation for now, and we'll discuss the steps for a cross compiled package in another issue? I think then we can easily merge this for now, and do the further steps separated.

@rgbkrk
Copy link
Member

rgbkrk commented Jun 24, 2017

I like the way this went, I'll go ahead and merge.

@rgbkrk rgbkrk merged commit 18cee9f into zeromq:master Jun 24, 2017
@sharathbaddam
Copy link
Contributor Author

@interpretor @rgbkrk thanks for accepting the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants