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

mcaCanberra, mcaAIM, and nmcDemo are built unconditionally on OS X #9

Open
kmpeters opened this issue Oct 26, 2016 · 4 comments
Open

Comments

@kmpeters
Copy link
Member

mcaApp/CanberraSrc/Makefile allows mcaCamberra, mcaAIM, and nmcDemo to be easily omitted from the build on Linux:

# Linux
# To build for Linux system uncomment the following lines.  This requires libnet or
# LLC sockets
ifeq ($(LINUX_NET_INSTALLED), YES)
LIBRARY_IOC_Linux += mcaCanberra
PROD_IOC_Linux    += mcaAIM
PROD_IOC_Linux    += nmcDemo
endif

But not on OS X (Darwin):

# Darwin
LIBRARY_IOC_Darwin          += mcaCanberra
PROD_IOC_Darwin             += mcaAIM
PROD_IOC_Darwin             += nmcDemo

I don't know if the correct approach is to add DARWIN_NET_INSTALLED to mca's configure/CONFIG_APP or to change LINUX_NET_INSTALLED to something more general that applies to both Linux and OS X.

@kmpeters
Copy link
Member Author

OS X builds are broken if libnet isn't installed:

cc -c            -DUSE_LIBNET -g `libnet-config --defines`     -DUNIX  -Ddarwin     -O3 -g   -Wall     -DUSE_LIBNET -g `libnet-config --defines`    -arch x86_64    -fno-common -fPIC -MMD -I. -I../O.Common -I. -I.. -I../../../include/os/Darwin -I../../../include    -I/Users/kpetersn/synApps_testing/3.14/synApps/support/calc/include  -I/Users/kpetersn/synApps_testing/3.14/synApps/support/sscan/include  -I/Users/kpetersn/synApps_testing/3.14/synApps/support/busy/include  -I/Users/kpetersn/synApps_testing/3.14/synApps/support/std/include  -I/Users/kpetersn/synApps_testing/3.14/synApps/support/seq-2-2-3/include -I/Users/kpetersn/synApps_testing/3.14/synApps/support/autosave/include/os/Darwin -I/Users/kpetersn/synApps_testing/3.14/synApps/support/autosave/include  -I/Users/kpetersn/synApps_testing/3.14/synApps/support/asyn/include  -I/Users/kpetersn/synApps_testing/3.14/synApps/support/mca/include -I/Users/kpetersn/synApps_testing/3.14/base-3.14.12.5/include/os/Darwin -I/Users/kpetersn/synApps_testing/3.14/base-3.14.12.5/include        ../nmc_comm_subs_1.c 
/bin/sh: libnet-config: command not found
/bin/sh: libnet-config: command not found
In file included from ../nmc_comm_subs_1.c:72:
../nmc_sys_defs.h:56:14: fatal error: 'libnet.h' file not found
    #include <libnet.h>
             ^
1 error generated.
make[3]: *** [nmc_comm_subs_1.o] Error 1
make[2]: *** [install.darwin-x86] Error 2
make[1]: *** [CanberraSrc.install] Error 2
make: *** [mcaApp.install] Error 2

@MarkRivers
Copy link
Member

I would suggest changing LINUX_NET_INSTALLED to LIBNET_INSTALLED or better HAVE_LIBNET, which is the syntax that many packages use.

@kmpeters
Copy link
Member Author

I will change it to HAVE_LIBNET and create a pull request.

@jeonghanlee
Copy link

  • Do we have that option in the master branch?
  • After installing libnet on OS X through brew, makefile still cannot find libnet.h. The following trick works
USR_CFLAGS_Darwin           += -g `libnet-config --defines --cflags`
USR_CPPFLAGS_Darwin         += -g `libnet-config --defines --cflags`
USR_LDFLAGS_Darwin         += `libnet-config --libs`
mcaCanberra_SYS_LIBS_Darwin += pcap
mcaAIM_SYS_LIBS_Darwin      += pcap
nmcDemo_SYS_LIBS_Darwin     += pcap

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

No branches or pull requests

3 participants