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

Trying compiling GEOtop v3.0 under windows with CLion #99

Open
yakopuz opened this issue Nov 27, 2018 · 3 comments
Open

Trying compiling GEOtop v3.0 under windows with CLion #99

yakopuz opened this issue Nov 27, 2018 · 3 comments

Comments

@yakopuz
Copy link
Collaborator

yakopuz commented Nov 27, 2018

Hi,
I´m trying to compile GEOtop v3.0 under windows with CLion.
Installed Clion, installed MinGW version 5.0, dowloaded branch v3.0 under git incorpotated with CLion ...
all incredibly smooth ....

Now first error****
t_io.cc: L 12:

   char parent[PATH_MAX], *p;```

Is the function

```int mkdirp(const char *pathname, mode_t mode) {
  /* From http://niallohiggins.com/2009/01/08/mkpath-mkdir-p-alike-in-c-for-unix/ */
  char parent[PATH_MAX], *p;

  /* make a parent directory path */
  strncpy(parent, pathname, sizeof(parent));
  parent[sizeof(parent) - 1] = '\0';
  for (p = parent + strlen(parent); *p != '/' && p != parent; p--);
  *p = '\0';

  /* try make parent directory */
  if (p != parent && mkdirp(parent, mode) != 0)
    return -1;

  /* make this one if parent has been made */
  if (mkdir(pathname, mode) == 0)
    return 0;

  /* if it already exists that is fine */
  if (errno == EEXIST) {
    struct stat sb;
    stat(pathname, &sb);
    if (!S_ISDIR(sb.st_mode)) {
      /* pathname is NOT a directory! */
      return -1;
    }
    return 0;
  }
  return -1;
}```

Is this function system-dependent? It seems then the system does not recognize  linux command as dir and so on?

Is it possible to get rid of this or have a windows - friendly version?
@cozzini
Copy link
Member

cozzini commented Nov 28, 2018 via email

@ssenoner
Copy link
Collaborator

what about to implement it that it works for Linux and Windows, removing the placeholder Problem?
https://stackoverflow.com/a/29828907

@asartori86
Copy link
Collaborator

Or, if we plan to have boost as dependency, we may use boost::filesystem::create_directory

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

4 participants