No sources to compile?

1,651 views
Skip to first unread message

Henrik Jönsson

unread,
Jan 27, 2014, 10:02:17 AM1/27/14
to mave...@googlegroups.com
Hi,

I'm trying to setup nar on a small static gcc lib. But I have problem with the compile step. Nar doesn't seem to find my C file.

I'm using the recommended directory structure:
src
  main
    c
      UASList.c
    include
      UASList.h
pom.xml

Can anyone of you spot any problems in my files?

Maven says:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building UASList 2.5
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- nar-maven-plugin:3.0.0:nar-validate (default-nar-validate) @ uaslist ---
[INFO] Using AOL: x86-Windows-gcc
[INFO] 
[INFO] --- nar-maven-plugin:3.0.0:nar-download (default-nar-download) @ uaslist ---
[INFO] Preparing Nar dependencies
[INFO] Unpacking 0 dependencies to D:\workspace\ede\UASList\target\nar
[INFO] 
[INFO] --- nar-maven-plugin:3.0.0:nar-unpack (default-nar-unpack) @ uaslist ---
[INFO] Unpacking 0 dependencies to D:\workspace\ede\UASList\target\nar
[INFO] 
[INFO] --- nar-maven-plugin:3.0.0:nar-gnu-configure (default-nar-gnu-configure) @ uaslist ---
[INFO] 
[INFO] --- nar-maven-plugin:3.0.0:nar-system-generate (default-nar-system-generate) @ uaslist ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ uaslist ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\workspace\ede\UASList\src\main\resources
[INFO] 
[INFO] --- nar-maven-plugin:3.0.0:nar-resources (default-nar-resources) @ uaslist ---
[INFO] Copied 0 resources
[INFO] 
[INFO] --- nar-maven-plugin:3.0.0:nar-gnu-resources (default-nar-gnu-resources) @ uaslist ---
[INFO] 
[INFO] --- nar-maven-plugin:3.0.0:nar-vcproj (default-nar-vcproj) @ uaslist ---
[INFO] NAR: Skipping vcproj generation.  Run with -P windows-debug to enable this step.
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ uaslist ---
[INFO] No sources to compile
[INFO] 
[INFO] --- nar-maven-plugin:3.0.0:nar-javah (default-nar-javah) @ uaslist ---
[INFO] 
[INFO] --- nar-maven-plugin:3.0.0:nar-gnu-make (default-nar-gnu-make) @ uaslist ---
[INFO] 
[INFO] --- nar-maven-plugin:3.0.0:nar-compile (default-nar-compile) @ uaslist ---
[INFO] Preparing Nar dependencies
[INFO] Unpacking 0 dependencies to D:\workspace\ede\UASList\target\nar
[INFO] Nothing to compile
[INFO] 
[INFO] --- nar-maven-plugin:3.0.0:nar-gnu-process (default-nar-gnu-process) @ uaslist ---
[INFO] 
[INFO] --- nar-maven-plugin:3.0.0:nar-process-libraries (default-nar-process-libraries) @ uaslist ---
[info] Running process libraries
[info] Processing library Library: type: static
[INFO] 
[INFO] --- nar-maven-plugin:3.0.0:nar-prepare-package (default-nar-prepare-package) @ uaslist ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ uaslist ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\workspace\ede\UASList\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ uaslist ---
[INFO] No sources to compile
[INFO] 
[INFO] --- nar-maven-plugin:3.0.0:nar-testCompile (default-nar-testCompile) @ uaslist ---
[INFO] Preparing Nar dependencies
[INFO] Unpacking 0 dependencies to D:\workspace\ede\UASList\target\test-nar
[INFO] 
[INFO] --- maven-surefire-plugin:2.16:test (default-test) @ uaslist ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- nar-maven-plugin:3.0.0:nar-test (default-nar-test) @ uaslist ---
[INFO] Preparing Nar dependencies
[INFO] Unpacking 0 dependencies to D:\workspace\ede\UASList\target\test-nar
[INFO] 
[INFO] --- nar-maven-plugin:3.0.0:nar-prepare-package (default-nar-prepare-package-1) @ uaslist ---
[INFO] 
[INFO] --- nar-maven-plugin:3.0.0:nar-package (default-nar-package) @ uaslist ---
[INFO] Building zip: D:\workspace\ede\UASList\target\uaslist-2.5-noarch.nar
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ uaslist ---
[INFO] Building jar: D:\workspace\ede\UASList\target\uaslist-2.5.jar
[INFO] 
[INFO] --- nar-maven-plugin:3.0.0:nar-integration-test (default-nar-integration-test) @ uaslist ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-install-plugin:2.5.1:install (default-install) @ uaslist ---
[INFO] Installing D:\workspace\ede\UASList\target\uaslist-2.5.jar to D:\hjonsson\.m2\repository\com\bombardier\uaslist\2.5\uaslist-2.5.nar
[INFO] Installing D:\workspace\ede\UASList\pom.xml to D:\hjonsson\.m2\repository\com\bombardier\uaslist\2.5\uaslist-2.5.pom
[INFO] Installing D:\workspace\ede\UASList\target\uaslist-2.5-noarch.nar to D:\hjonsson\.m2\repository\com\bombardier\uaslist\2.5\uaslist-2.5-noarch.nar
[INFO] 
[INFO] --- maven-deploy-plugin:2.8.1:deploy (default-deploy) @ uaslist ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.204s
[INFO] Finished at: Mon Jan 27 15:52:59 CET 2014
[INFO] Final Memory: 9M/21M
[INFO] ------------------------------------------------------------------------

My pom looks like this:
<modelVersion>4.0.0</modelVersion>
<groupId>com.bombardier</groupId>
<artifactId>uaslist</artifactId>
<version>2.5</version>
<name>UASList</name>
<packaging>nar</packaging>

<properties>
<skipTests>true</skipTests>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>    
</properties>

<build>
<plugins>
<plugin>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<version>3.0.0</version>
<extensions>true</extensions>
<configuration>
<gnuUseOnWindows>true</gnuUseOnWindows>
<linker>
<name>gcc</name>
</linker>
<c>
<name>gcc</name>
</c>
<libraries>
<library>
<type>static</type>
</library>
</libraries>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<version>3.0.0</version>
</dependency>
</dependencies>

<distributionManagement>
<repository>
<id>ebitool.releases</id>
<name>EBITool Releases</name>
<url>removed</url>
</repository>
</distributionManagement>
</project>

Greg Domjan

unread,
Jan 27, 2014, 11:38:32 AM1/27/14
to mave...@googlegroups.com

The problem is there are no default includes because the aol.properties are
* too specific.
* don't contain  gcc.Windows.c  settings.

Some things you can do to investigate further and possible resolve.

Build using mvn -X option to get debug output and more detail on what it is searching for to find compilable files. (double check my analysis)

Possible resolutions in your config
1.  gpp instead of gcc (not familiar with variations myself)

2. This will find the files, not sure if the compiler will actually work though
<c>
<name>gcc</name>
<includes><include>**/*.c</include></includes>
</c>

3.  Use a custom aol.properties file for the project - make a file aol.properties in the project.basedir
GPP might be good as an example - https://github.com/maven-nar/nar-maven-plugin/blob/master/src/main/resources/com/github/maven_nar/aol.properties

Henrik Jönsson

unread,
Jan 28, 2014, 4:03:01 AM1/28/14
to mave...@googlegroups.com
Thanks for you quick answer!

It seems to work when I add:
<includes><include>**/*.c</include></includes>

I thought this was the standard behavior. But it seems like
x86.Windows.gpp.c.includes=**/*.c
exists, but not this:
x86.Windows.gcc.c.includes=**/*.c
in the built-in aol.properties file.

Is this because the primary purpose of nar is to run javah (with g++)?

Best regards
Henrik

Greg Domjan

unread,
Jan 29, 2014, 9:23:18 AM1/29/14
to mave...@googlegroups.com
Hi Henrik,

I would not put javah as the primary purpose, just one of various.

The reason behind the limitation is more that the configuration
* is incomplete based only what people have needed so far
* in being as flexible as possible has not also been made as a simple as possible and so each combination must be specfied seperately, and nobody has tried that combination yet.

As I most use msvc daily I'm not aware of the differences between using gpp and gcc, went looking and found http://stackoverflow.com/questions/172587/what-is-the-difference-between-g-and-gcc
With that I would call the linker GCC, the C compiler gcc, the CPP compiler gpp/g++.  

Have raised issue of how this should be configured on the github issues board

We welcome very much input from others, pull requests help a lot.

Greg
Reply all
Reply to author
Forward
0 new messages