Open MPI logo

Hardware Locality Users' Mailing List Archives

  |   Home   |   Support   |   FAQ   |  

This web mail archive is frozen.

This page is part of a frozen web archive of this mailing list.

You can still navigate around this archive, but know that no new mails have been added to it since July of 2016.

Click here to be taken to the new web archives of this list; it includes all the mails that are in this frozen archive plus all new mails that have been sent to the list since it was migrated to the new archives.

Subject: Re: [hwloc-users] Single hwloc.h header files that work on linux and windows
From: Samuel Thibault (samuel.thibault_at_[hidden])
Date: 2013-01-03 16:42:33


Rolf vandeVaart, le Thu 03 Jan 2013 22:30:58 +0100, a écrit :
> And config.h is specific to how the library was configured.

Not very much actually.

> Is there a special hwloc.h and supporting headers that is system independent so
> I can include them and build on both windows and linux?

There isn't any at the moment.

> Or do I need to have two different sets of header files, one for linux
> and one for windows? Perhaps I just need a config.h for windows and
> one for linux and select them at build time.

That should probably work. The whole beginning of config.h is always
the same. The only generated parts is the following, with comments:

- HWLOC_LINUX_SYS: just to know whether we are on Linux. That could have
  been an #ifdef __linux__ actually. That just defines whether
  hwloc_set_linuxfs_hooks is available, and enables some parts of the
  inlines, which you don't care about.

- HWLOC_HAVE_CPU_SET: That just defines whether we can provide the glibc
  inlines. Again, you don't care.

- HWLOC_HAVE_WINDOWS_H: Used only below in config.h, to provide the
  proper definition on windows or on Unix.

- hwloc_pid_t/hwloc_thread_t: will be either pid_t/pthread_t or HANDLE,
  depending on being on Unix or Windows.

  are only used for the embedded case, which I don't think you want to

So to summarize, having a windows version and a unix version should just