DeepTime icon indicating copy to clipboard operation
DeepTime copied to clipboard

How to run your code in Windows

Open sophia-sxx opened this issue 3 years ago • 6 comments

hello, My computer system is Windows. There are always errors when I run make. Can I write a method to run it directly in python xx.py without using make.

For example, when I run the code make build-all path=experiments/configs/ETTm2, I get the following error:

/usr/bin/sh: line 1: make: command not found
/usr/bin/sh: line 1: make: command not found
/usr/bin/sh: line 1: make: command not found
/usr/bin/sh: line 1: make: command not found
/usr/bin/sh: line 1: make: command not found
/usr/bin/sh: line 1: make: command not found
/usr/bin/sh: line 1: make: command not found
/usr/bin/sh: line 1: make: command not found
make: *** [Makefile:7: build-all] Error 127

In addition, I tried various methods to install make, but they couldn't solve this problem.(it may be my computer problem)

Thank you.

sophia-sxx avatar Jan 05 '23 06:01 sophia-sxx

It's a bad fix, but if you use WSL, you should be able to use make in Linux. WSL has a mount point on the Windows system, so you should be able to move your files/software between the two easily

pauljones0 avatar Jan 13 '23 05:01 pauljones0

这是一个不好的修复,但如果你使用 WSL,你应该能够在 Linux 中使用 make。WSL 在 Windows 系统上有一个挂载点,所以你应该能够轻松地在两者之间移动你的文件/软件

Thank you very much. I will try it when I have time

sophia-sxx avatar Jan 15 '23 02:01 sophia-sxx

you need to install make,referance https://gnuwin32.sourceforge.net/packages/make.htm, then configure environment variables, next,you can run make command

linbingkong avatar Aug 08 '23 06:08 linbingkong

maybe you have not configure environment variables about the make

linbingkong avatar Aug 08 '23 06:08 linbingkong

Hi, i found a solution for windows from https://stackoverflow.com/questions/32127524/how-to-install-and-use-make-in-windows. I tried the answer provided by MosGeo and it works. Open cmd and run winget install gnuwin32.make; add C:\Program Files (x86)\GnuWin32\bin into windows PATH environment variable. I also add C:\Program Files\Git\mingw64 into it. ps. I've seen someone (but i don't remember where) add new system variable, with name make and value C:\Program Files (x86)\GnuWin32\bin\make.exe. Then we can use make command.

Another problem is, when building experiments, there may occur process_begin: CreateProcess(NULL, dirname E:/xxx/DeepTime-main/makefile, ...) failed. This may be caused by some commands in the makefile that cannot be recognized by windows system, I changed ROOT := $(shell dirname $(realpath $(firstword ${MAKEFILE_LIST}))) into ROOT := $(subst /,\,$(dir $(realpath $(firstword $(MAKEFILE_LIST))))), then it works. I'm not familiar with linux and i just got this solution from gpt, so i'm not sure whether it is reasonable. As gpt also suggested to change

for config in $(shell ls ${path}/*.gin); do \
  make build config=$$config; \
done

into

for config in $(subst /,\,$(wildcard $(path)/*.gin)); do \
  make build config=$$config; \
done

but it failed (so i can't use build-all command either).

lorraine-sun avatar Aug 31 '23 08:08 lorraine-sun

Hi guys, sorry for the late reply. The makefile is just calling this command python -m experiments.forecast --config_path=${config} build_experiment to generate the command files. You can run the python script directly.

gorold avatar Sep 15 '23 03:09 gorold