Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#64559 closed defect (fixed)

ncplot @4.9.12: Use the right flags and compiler

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: mf2k (Frank Schima)
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: Cc:
Port: ncplot

Description

The ncplot build is not using the cflags, cppflags, ldflags MacPorts wants it to. For example:

https://build.macports.org/builders/ports-11_arm64-builder/builds/45812/steps/install-port/logs/stdio

/usr/bin/clang++ -arch arm64 -Wall -g -O2 -I/opt/X11/include -DPNG -Wno-write-strings -Wno-overflow -c ncplot.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
  • -Os is not present but -O2 is
  • -I/opt/local/include is not present but -I/opt/X11/include (which we don't want) is
  • -stdlib=libc++ is not present which we would want when compiling C++ software but in fact this port is erroneously using the C++ compiler to compile C code. That's coming from the portfile:
CC="${configure.cxx} [get_canonical_archflags cxx]"

The portfile could be simplified, and many of these problems could be corrected, by letting the makefile portgroup handle these details for you (though you'll probably still need to manually address the unwanted -I/opt/X11/include and -L/opt/X11/lib flags).

Change History (4)

comment:1 Changed 3 years ago by mf2k (Frank Schima)

Using cc instead of cxx causes a build error:

:info:build /opt/local/var/macports/build/_opt_mports_macports-ports_science_ncplot/ncplot/work/compwrap/cc/usr/bin/clang -Wall -g -O2 -I/opt/X11/include -DPNG -Wno-write-strings -Wno-overflow -c color.c
:info:build In file included from global.c:11:
:info:build ./define.h:14:10: fatal error: 'algorithm' file not found
:info:build #include <algorithm>
:info:build          ^~~~~~~~~~~

Apparently algorithm is in C++ and not C.

Last edited 3 years ago by mf2k (Frank Schima) (previous) (diff)

comment:2 Changed 3 years ago by mf2k (Frank Schima)

In 3d56ea358812d9808cd3d4d85d7743deb8f19e59/macports-ports (master):

ncplot: Fix some build flags

See: #64559

comment:3 Changed 3 years ago by mf2k (Frank Schima)

Resolution: fixed
Status: assignedclosed

In fdc80cd761af072aa4ec52f0a5082f8c0c5135de/macports-ports (master):

ncplot: Update to latest git commit

  • Use proper build args
  • Update dependencies

Fixes: #64559

comment:4 Changed 3 years ago by mf2k (Frank Schima)

I worked with upstream to fix most of the build issues. They acknowledge more work needs to be done (Converting more files from .c to .cc).

Last edited 3 years ago by mf2k (Frank Schima) (previous) (diff)
Note: See TracTickets for help on using tickets.